argocd

package
v0.1.63 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrItemLengthMismatch is returned when items are listed but the
	// wrong number are returned.  Given we are dealing with unique applications
	// one or zero are expected.
	ErrItemLengthMismatch = errors.New("item count not as expected")
)

Functions

This section is empty.

Types

type ClusterConfig

type ClusterConfig struct {
	TLSClientConfig ClusterTLSClientConfig `json:"tlsClientConfig"`
}

type ClusterTLSClientConfig

type ClusterTLSClientConfig struct {
	CAData   []byte `json:"caData"`
	CertData []byte `json:"certData"`
	KeyData  []byte `json:"keyData"`
}

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver implements a CD driver for ArgoCD. Applications are fairly straight forward as they are implemented with custom resources. We use the application ID to generate a resource name, and labels to make them unique and add context, plus this thwarts the 63 character limit. There is no custom resource for clusters, so have to use the API.

func New

func New(client client.Client, options Options) *Driver

New creates a new ArgoCD driver.

func (*Driver) CreateOrUpdateCluster

func (d *Driver) CreateOrUpdateCluster(ctx context.Context, id *cd.ResourceIdentifier, cluster *cd.Cluster) error

CreateOrUpdateCluster creates or updates a cluster idempotently.

func (*Driver) CreateOrUpdateHelmApplication

func (d *Driver) CreateOrUpdateHelmApplication(ctx context.Context, id *cd.ResourceIdentifier, app *cd.HelmApplication) error

CreateOrUpdateHelmApplication creates or updates a helm application idempotently.

func (*Driver) DeleteCluster

func (d *Driver) DeleteCluster(ctx context.Context, id *cd.ResourceIdentifier) error

DeleteCluster deletes an existing cluster.

func (*Driver) DeleteHelmApplication

func (d *Driver) DeleteHelmApplication(ctx context.Context, id *cd.ResourceIdentifier, backgroundDelete bool) error

DeleteHelmApplication deletes an existing helm application.

func (*Driver) GetClusterSecret

func (d *Driver) GetClusterSecret(ctx context.Context, id *cd.ResourceIdentifier) (*corev1.Secret, error)

GetClusterSecret looks up the cluster secret via the ID, which is present for both create and delete interfaces.

func (*Driver) GetHelmApplication

func (d *Driver) GetHelmApplication(ctx context.Context, id *cd.ResourceIdentifier) (*argoprojv1.Application, error)

GetHelmApplication retrieves an abstract helm application.

func (*Driver) Kind

func (d *Driver) Kind() cd.DriverKind

Kind returns the driver kind.

type Options

type Options struct {
	K8SAPITester util.K8SAPITester
}

Jump to

Keyboard shortcuts

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