argocd

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

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, wg *sync.WaitGroup, timeout time.Duration) 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"`
	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"`
	CertData  string              `yaml:"certData"`
	CaData    string              `yaml:"caData"`
	KeyData   string              `yaml:"keyData"`
}

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, wg *sync.WaitGroup, timeout time.Duration) 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 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, wg *sync.WaitGroup, timeout time.Duration) error

Jump to

Keyboard shortcuts

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