Documentation ¶
Index ¶
- func FilterApplicationsForUpdate(apps []v1alpha1.Application, patterns []string) (map[string]ApplicationImages, error)
- func GetImagesFromApplication(app *v1alpha1.Application) image.ContainerImageList
- func IsValidApplicationType(app *v1alpha1.Application) bool
- func SetHelmImage(app *v1alpha1.Application, newImage *image.ContainerImage) error
- func SetKustomizeImage(app *v1alpha1.Application, newImage *image.ContainerImage) error
- type ApplicationImages
- type ApplicationType
- type ArgoCD
- type ClientOptions
- type ImageList
- type ImageUpdaterResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterApplicationsForUpdate ¶
func FilterApplicationsForUpdate(apps []v1alpha1.Application, patterns []string) (map[string]ApplicationImages, error)
Retrieve a list of applications from ArgoCD that qualify for image updates Application needs either to be of type Kustomize or Helm and must have the correct annotation in order to be considered.
func GetImagesFromApplication ¶ added in v0.2.0
func GetImagesFromApplication(app *v1alpha1.Application) image.ContainerImageList
GetImagesFromApplication returns the list of known images for the given application
func IsValidApplicationType ¶
func IsValidApplicationType(app *v1alpha1.Application) bool
IsValidApplicationType returns true if we can update the application
func SetHelmImage ¶ added in v0.4.0
func SetHelmImage(app *v1alpha1.Application, newImage *image.ContainerImage) error
SetHelmImage sets image parameters for a Helm application
func SetKustomizeImage ¶ added in v0.4.0
func SetKustomizeImage(app *v1alpha1.Application, newImage *image.ContainerImage) error
SetKustomizeImage sets a Kustomize image for given application
Types ¶
type ApplicationImages ¶
type ApplicationImages struct { Application v1alpha1.Application Images image.ContainerImageList }
type ApplicationType ¶
type ApplicationType int
Type of the application
const ( ApplicationTypeUnsupported ApplicationType = 0 ApplicationTypeHelm ApplicationType = 1 ApplicationTypeKustomize ApplicationType = 2 )
func GetApplicationType ¶ added in v0.2.0
func GetApplicationType(app *v1alpha1.Application) ApplicationType
GetApplicationType returns the type of the ArgoCD application
func GetApplicationTypeByName ¶ added in v0.4.0
func GetApplicationTypeByName(client ArgoCD, appName string) (ApplicationType, error)
GetApplicationTypeByName first retrieves application with given appName and returns its application type
func (ApplicationType) String ¶
func (a ApplicationType) String() string
String returns a string representation of the application type
type ArgoCD ¶
type ArgoCD interface { GetApplication(ctx context.Context, appName string) (*v1alpha1.Application, error) ListApplications() ([]v1alpha1.Application, error) UpdateSpec(ctx context.Context, spec *application.ApplicationUpdateSpecRequest) (*v1alpha1.ApplicationSpec, error) }
ArgoCD is the interface for accessing Argo CD functions we need
func NewClient ¶
func NewClient(opts *ClientOptions) (ArgoCD, error)
NewClient creates a new API client for ArgoCD and connects to the ArgoCD API server.
type ClientOptions ¶
type ClientOptions struct { ServerAddr string Insecure bool Plaintext bool Certfile string GRPCWeb bool GRPCWebRootPath string AuthToken string }
Basic wrapper struct for ArgoCD client options
type ImageList ¶
type ImageList map[string]ApplicationImages
Will hold a list of applications with the images allowed to considered for update.
type ImageUpdaterResult ¶ added in v0.4.0
type ImageUpdaterResult struct { NumApplicationsProcessed int NumImagesFound int NumImagesUpdated int NumImagesConsidered int NumSkipped int NumErrors int }
Stores some statistics about the results of a run
func UpdateApplication ¶ added in v0.4.0
func UpdateApplication(newRegFn registry.NewRegistryClient, argoClient ArgoCD, kubeClient *client.KubernetesClient, curApplication *ApplicationImages, dryRun bool) ImageUpdaterResult
UpdateApplication update all images of a single application. Will run in a goroutine.