argocd

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterApplicationsForUpdate

func FilterApplicationsForUpdate(apps []v1alpha1.Application) (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

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 (ApplicationType) String

func (a ApplicationType) String() string

String returns a string representation of the application type

type ArgoCD

type ArgoCD struct {
	Client argocdclient.Client
}

func NewClient

func NewClient(opts *ClientOptions) (*ArgoCD, error)

NewClient creates a new API client for ArgoCD and connects to the ArgoCD API server.

func (*ArgoCD) GetApplicationTypeByName

func (client *ArgoCD) GetApplicationTypeByName(appName string) (ApplicationType, error)

GetApplicationTypeByName first retrieves application with given appName and returns its application type

func (*ArgoCD) ListApplications

func (client *ArgoCD) ListApplications() ([]v1alpha1.Application, error)

ListApplications returns a list of all application names that the API user has access to.

func (*ArgoCD) SetHelmImage

func (client *ArgoCD) SetHelmImage(app *v1alpha1.Application, newImage *image.ContainerImage) error

SetHelmImage sets image parameters for a Helm application

func (*ArgoCD) SetKustomizeImage

func (client *ArgoCD) SetKustomizeImage(app *v1alpha1.Application, newImage *image.ContainerImage) error

SetKustomizeImage sets a Kustomize image for given application

type ArgoCDClient

type ArgoCDClient interface {
	ListApplications() ([]v1alpha1.Application, error)
	SetHelmImage(appName string, newImage *image.ContainerImage) error
	GetImagesFromApplication(appName string) (image.ContainerImageList, error)
	GetApplicationTypeByName(appName string) (ApplicationType, error)
}

Interface that we need mocks for

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.

Jump to

Keyboard shortcuts

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