Documentation ¶
Index ¶
- Variables
- type Application
- type ApplicationDestination
- type ApplicationMetadata
- type ApplicationSource
- type ApplicationSourceHelm
- type ApplicationSpec
- type ArgoCD
- type ContainerLog
- type ContainerLogParams
- type DeployApplicationRequest
- type ErrorResponse
- type EventParam
- type Factory
- type Hook
- type ResourceParams
- type Strategy
- type SyncOptions
- type SyncPolicy
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { APIVersion string `json:"apiVersion" yaml:"apiVersion"` Kind string `json:"kind" yaml:"kind"` Metadata ApplicationMetadata `json:"metadata" yaml:"metadata"` Spec ApplicationSpec `json:"spec" yaml:"spec"` }
type ApplicationDestination ¶
type ApplicationDestination struct { // Server overrides the environment server value in the ksonnet app.yaml Server string `json:"server" yaml:"server,omitempty"` // Namespace overrides the environment namespace value in the ksonnet app.yaml Namespace string `json:"namespace" yaml:"namespace,omitempty"` }
ApplicationDestination contains deployment destination information
type ApplicationMetadata ¶
type ApplicationSource ¶
type ApplicationSource struct { // RepoURL is the repository GitlabHTTPS of the application manifests RepoURL string `json:"repoURL" yaml:"repoURL"` // Path is a directory path within the Git repository Path string `json:"path" yaml:"path,omitempty"` // TargetRevision defines the commit, tag, or branch in which to sync the application to. // If omitted, will sync to HEAD TargetRevision string `json:"targetRevision" yaml:"targetRevision,omitempty"` // Helm holds helm specific options Helm *ApplicationSourceHelm `json:"helm" yaml:"helm,omitempty"` }
ApplicationSource contains information about github repository, path within repository and target application environment.
type ApplicationSourceHelm ¶
type ApplicationSourceHelm struct { // ValuesFiles is a list of Helm value files to use when generating a template ValueFiles []string `json:"valueFiles" yaml:"valueFiles,omitempty"` }
ApplicationSourceHelm holds helm specific options
type ApplicationSpec ¶
type ApplicationSpec struct { // Source is a reference to the location ksonnet application definition Source ApplicationSource `json:"source" yaml:"source"` // Destination overrides the kubernetes server and namespace defined in the environment ksonnet app.yaml Destination ApplicationDestination `json:"destination" yaml:"destination"` // Project is a application project name. Empty name means that application belongs to 'default' project. Project string `json:"project" yaml:"project"` // SyncPolicy controls when a sync will be performed SyncPolicy *SyncPolicy `json:"syncPolicy" yaml:"syncPolicy,omitempty"` }
ApplicationSpec represents desired application state. Contains link to repository with application definition and additional parameters link definition revision.
type ArgoCD ¶
type ArgoCD interface { // AssembleArgoApplication assemble application by params AssembleArgoApplication(name, namespace, gitRepoURL, server string, valueFiles []string, targetRevision string) *Application // CreateApplication create an application in argoCD CreateApplication(ctx context.Context, manifest []byte) error // DeployApplication deploy an application in argoCD DeployApplication(ctx context.Context, application string, revision string) error // DeleteApplication delete an application in argoCD // You need to delete Argo Application first, then delete gitlab repo, // otherwise Argo Application can never be deleted. // ref:https://argoproj.github.io/argo-cd/faq/#ive-deletedcorrupted-my-repo-and-cant-delete-my-app DeleteApplication(ctx context.Context, application string) error // WaitApplication Wait for the app sync to complete WaitApplication(ctx context.Context, application string, uid string, status int) error // GetApplication get an application in argoCD GetApplication(ctx context.Context, application string) (*v1alpha1.Application, error) // RefreshApplication ... RefreshApplication(ctx context.Context, application string) (app *v1alpha1.Application, err error) // GetApplicationTree get resource-tree of an application in argoCD GetApplicationTree(ctx context.Context, application string) (*v1alpha1.ApplicationTree, error) // GetApplicationResource get a resource under an application in argoCD GetApplicationResource(ctx context.Context, application string, param ResourceParams, resource interface{}) error // ListResourceEvents get resource's events of an application in argoCD ListResourceEvents(ctx context.Context, application string, param EventParam) (*corev1.EventList, error) // ResumeRollout ... ResumeRollout(ctx context.Context, application string) error // GetContainerLog get standard output of container of an application in argoCD GetContainerLog(ctx context.Context, application string, param ContainerLogParams) (<-chan ContainerLog, <-chan error, error) }
ArgoCD interact with ArgoCD Server
type ContainerLog ¶
type ContainerLogParams ¶
type ContainerLogParams struct { Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` PodName string `json:"podName,omitempty" yaml:"podName,omitempty"` ContainerName string `json:"containerName,omitempty" yaml:"containerName,omitempty"` TailLines int `json:"tailLines,omitempty" yaml:"tailLines,omitempty"` }
ContainerLogParams the params for GetContainerLog
type ErrorResponse ¶
type EventParam ¶
type EventParam struct { ResourceNamespace string `json:"resourceNamespace"` ResourceUID string `json:"resourceUID"` ResourceName string `json:"resourceName"` }
EventParam the params for ListResourceEvents
type Factory ¶
func NewFactory ¶
func NewFactory(argoCDMapper argocd.Mapper, regionArgoCDMapper argocd.RegionMapper) Factory
type ResourceParams ¶
type ResourceParams struct { // Group name in k8s, for example, Deployment resource is in 'apps' group Group string `json:"group,omitempty"` // Version in k8s, for example, Deployment resource has a 'v1' version Version string `json:"version,omitempty"` // the Kind of resource in k8s, for example, the kind of Deployment resource is 'Deployment' Kind string `json:"kind,omitempty"` // the namespace of a resource in k8s Namespace string `json:"namespace,omitempty"` // the resource name ResourceName string `json:"resourceName,omitempty"` }
ResourceParams the params for GetApplicationResource
type SyncOptions ¶
type SyncOptions []string
type SyncPolicy ¶
type SyncPolicy struct { // Options allow you to specify whole app sync-options SyncOptions SyncOptions `json:"syncOptions" yaml:"syncOptions,omitempty"` }
SyncPolicy controls when a sync will be performed in response to updates in git