state

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success      = "success"       // deployed successfully
	Failed       = "failed"        // failed to deploy
	Deploying    = "deploying"     // deployment in progress
	NotDeployed  = "not_deployed"  // package is in the bundle but not deployed
	Removing     = "removing"      // removal in progress
	Removed      = "removed"       // package removed (does not apply to BundleState)
	FailedRemove = "failed_remove" // package failed to be removed (does not apply to BundleState)
	Unreferenced = "unreferenced"  // package has been removed from the bundle but still exists in the cluster

)

Variables

This section is empty.

Functions

func GetDeployedPackageNames

func GetDeployedPackageNames() []string

GetDeployedPackageNames returns the names of the packages that have been deployed

Types

type BundleState

type BundleState struct {
	Name        string      `json:"name"`
	Version     string      `json:"version"`
	PkgStatuses []PkgStatus `json:"packages"`
	Status      string      `json:"status"`
	DateUpdated time.Time   `json:"date_updated"`
}

type Client

type Client struct {
	Client  kubernetes.Interface
	Enabled bool
}

func NewClient

func NewClient(kc *cluster.Cluster, enableState bool) (*Client, error)

NewClient creates a new state Client

func (*Client) GetBundlePkgState

func (c *Client) GetBundlePkgState(b *types.UDSBundle, pkgName string) (*PkgStatus, error)

GetBundlePkgState checks if a package exists in the bundle state

func (*Client) GetBundleState

func (c *Client) GetBundleState(b *types.UDSBundle) (*BundleState, error)

GetBundleState gets the bundle state from the K8s cluster

func (*Client) GetUnreferencedPackages

func (c *Client) GetUnreferencedPackages(b *types.UDSBundle) ([]types.Package, error)

func (*Client) InitBundleState

func (c *Client) InitBundleState(b *types.UDSBundle, status string) error

InitBundleState initializes the bundle state in the K8s cluster if it doesn't exist. This can safely be called multiple times

func (*Client) RemoveBundleState

func (c *Client) RemoveBundleState(b *types.UDSBundle) error

RemoveBundleState removes the bundle state from the K8s cluster

func (*Client) RemovePackageFromState

func (c *Client) RemovePackageFromState(b *types.UDSBundle, pkgToRemove string) error

func (*Client) UpdateBundlePkgState

func (c *Client) UpdateBundlePkgState(b *types.UDSBundle, bundledPkg types.Package, status string) error

func (*Client) UpdateBundleState

func (c *Client) UpdateBundleState(b *types.UDSBundle, status string) error

UpdateBundleState updates the bundle state in the K8s cluster

type PkgStatus

type PkgStatus struct {
	Name        string    `json:"name"`
	Version     string    `json:"version"`
	Status      string    `json:"status"`
	DateUpdated time.Time `json:"date_updated"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL