argocd

package
v0.88.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultTimeout is the default timeout for waiting for an application to be healthy.
	DefaultTimeout = 420 * time.Second
)

Variables

This section is empty.

Functions

func AddClusterIDLabel added in v0.84.0

func AddClusterIDLabel(data map[string][]Application, appName, clusterID string, logger log.FieldLogger)

func DeleteK8sClusterFromRegistrationFile

func DeleteK8sClusterFromRegistrationFile(cluster *Argock8sRegister, clusterName string, filePath string) error

DeleteK8sClusterFromRegistrationFile take a argocd cluster file and delete Cluster from spec

func ReadArgoApplicationFile added in v0.84.0

func ReadArgoApplicationFile(appsFile []byte) (map[string][]Application, error)

ReadArgoApplicationFile take a argocd application file and load it into Application struct

func RemoveClusterIDLabel added in v0.84.0

func RemoveClusterIDLabel(data map[string][]Application, appName, clusterID string, logger log.FieldLogger)

func UpdateK8sClusterRegistrationFile

func UpdateK8sClusterRegistrationFile(cluster *Argock8sRegister, newCluster ArgocdClusterRegisterParameters, filePath string) error

UpdateK8sClusterRegistrationFile take a argocd cluster file and Add new Cluster spec

Types

type ApiClient added in v0.84.0

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

func NewClient added in v0.84.0

func NewClient(c *Connection, logger log.FieldLogger) (*ApiClient, error)

func (*ApiClient) SyncApplication added in v0.84.0

func (c *ApiClient) SyncApplication(gitopsAppName string) (*argoappv1.Application, error)

func (*ApiClient) WaitForAppHealthy added in v0.84.0

func (c *ApiClient) WaitForAppHealthy(appName string) error

type Application added in v0.84.0

type Application struct {
	Name              string             `yaml:"name"`
	Namespace         string             `yaml:"namespace"`
	Repo              string             `yaml:"repo"`
	Path              string             `yaml:"path"`
	Revision          string             `yaml:"revision"`
	Helm              Helm               `yaml:"helm"`
	ServerSideApply   bool               `yaml:"serverSideApply,omitempty"`
	Replace           bool               `yaml:"replace,omitempty"`
	IgnoreDifferences []IgnoreDifference `yaml:"ignoreDifferences,omitempty"`
	ClusterLabels     []Labels           `yaml:"cluster_labels"`
}

type ArgocdClusterLabels

type ArgocdClusterLabels struct {
	ClusterTypes string `yaml:"cluster-type"`
	ClusterID    string `yaml:"cluster-id"`
}

type ArgocdClusterRegisterParameters

type ArgocdClusterRegisterParameters struct {
	Name          string              `yaml:"name"`
	Type          string              `yaml:"type"`
	Labels        ArgocdClusterLabels `yaml:"labels"`
	APIServer     string              `yaml:"api_server"`
	ArgoCDRoleARN string              `yaml:"argoCDRoleARN,omitempty"`
	ClusterName   string              `yaml:"clusterName,omitempty"`
	CertData      string              `yaml:"certData,omitempty"`
	CaData        string              `yaml:"caData,omitempty"`
	KeyData       string              `yaml:"keyData,omitempty"`
}

type Argock8sRegister

type Argock8sRegister struct {
	Clusters []ArgocdClusterRegisterParameters `yaml:"clusters"`
}

func ReadArgoK8sRegistrationFile

func ReadArgoK8sRegistrationFile(clusterFile []byte) (*Argock8sRegister, error)

ReadArgoK8sRegistrationFile take a argocd cluster file and load it into Argock8sRegister struct

type Client added in v0.84.0

type Client interface {
	SyncApplication(gitopsAppName string) (*argoappv1.Application, error)
	WaitForAppHealthy(appName string) error
}

type Connection added in v0.84.0

type Connection struct {
	Address string
	Token   string
}

type Helm added in v0.84.0

type Helm struct {
	Enabled             bool `yaml:"enabled"`
	AdditionalManifests bool `yaml:"additionalManifests"`
}

type IgnoreDifference added in v0.88.0

type IgnoreDifference struct {
	Kind         string   `yaml:"kind"`
	Name         string   `yaml:"name"`
	Namespace    string   `yaml:"namespace"`
	JsonPointers []string `yaml:"jsonPointers"`
}

type Labels added in v0.84.0

type Labels struct {
	ClusterType string `yaml:"cluster-type,omitempty"`
	ClusterID   string `yaml:"cluster-id,omitempty"`
}

type NoOpClient added in v0.84.0

type NoOpClient struct{}

func (*NoOpClient) SyncApplication added in v0.84.0

func (n *NoOpClient) SyncApplication(gitopsAppName string) (*argoappv1.Application, error)

func (*NoOpClient) WaitForAppHealthy added in v0.84.0

func (n *NoOpClient) WaitForAppHealthy(appName string) error

Jump to

Keyboard shortcuts

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