Documentation
¶
Overview ¶
+k8s:deepcopy-gen=package +groupName=addonmgr.keikoproj.io
Index ¶
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type Addon
- func (a *Addon) CalculateChecksum() string
- func (a *Addon) ClearStatus()
- func (in *Addon) DeepCopy() *Addon
- func (in *Addon) DeepCopyInto(out *Addon)
- func (in *Addon) DeepCopyObject() runtime.Object
- func (a *Addon) GetAllAddonParameters() map[string]string
- func (a *Addon) GetFormattedWorkflowName(lifecycleStep LifecycleStep) string
- func (a *Addon) GetInstallStatus() ApplicationAssemblyPhase
- func (a *Addon) GetPackageSpec() PackageSpec
- func (a *Addon) GetPrereqStatus() ApplicationAssemblyPhase
- func (a *Addon) GetWorkflowType(step LifecycleStep) (*WorkflowType, error)
- func (a *Addon) SetInstallStatus(phase ApplicationAssemblyPhase, reasons ...string)
- func (a *Addon) SetPrereqAndInstallStatuses(phase ApplicationAssemblyPhase, reasons ...string) error
- func (a *Addon) SetStatusByLifecyleStep(step LifecycleStep, phase ApplicationAssemblyPhase, reasons ...string) error
- type AddonList
- type AddonOverridesSpec
- type AddonParams
- type AddonSpec
- type AddonStatus
- type AddonStatusLifecycle
- type ApplicationAssemblyPhase
- type ClusterContext
- type CmdType
- type DeploymentPhase
- type FlexString
- type KustomizeSpec
- type KustomizeTemplate
- type LifecycleStep
- type LifecycleWorkflowSpec
- type ObjectStatus
- type PackageSpec
- type PackageType
- type SecretCmdSpec
- type WorkflowType
Constants ¶
This section is empty.
Variables ¶
var ( SchemeGroupVersion = schema.GroupVersion{Group: "addonmgr.keikoproj.io", Version: "v1alpha1"} AddonSchemaGroupVersionKind = schema.GroupVersionKind{Group: "addonmgr.keikoproj.io", Version: "v1alpha1", Kind: "Addon"} )
SchemeGroupVersion is group version used to register these objects
var ( // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group-qualified GroupResource.
Types ¶
type Addon ¶
type Addon struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AddonSpec `json:"spec,omitempty"`
Status AddonStatus `json:"status,omitempty"`
}
Addon is the Schema for the addons API +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:resource:path=addons +kubebuilder:printcolumn:name="PACKAGE",type="string",JSONPath=".spec.pkgName" +kubebuilder:printcolumn:name="VERSION",type="string",JSONPath=".spec.pkgVersion" +kubebuilder:printcolumn:name="STATUS",type="string",JSONPath=".status.lifecycle.installed" +kubebuilder:printcolumn:name="REASON",type="string",JSONPath=".status.reason" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*Addon) CalculateChecksum ¶
CalculateChecksum converts the AddonSpec into a hash string (using Alder32 algo)
func (*Addon) ClearStatus ¶
func (a *Addon) ClearStatus()
func (*Addon) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Addon.
func (*Addon) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Addon) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Addon) GetAllAddonParameters ¶
GetAllAddonParameters returns an object copying the params submitted as part of the addon spec
func (*Addon) GetFormattedWorkflowName ¶
func (a *Addon) GetFormattedWorkflowName(lifecycleStep LifecycleStep) string
GetFormattedWorkflowName used the addon name, workflow prefix, addon checksum, and lifecycle step to compose the workflow name
func (*Addon) GetInstallStatus ¶
func (a *Addon) GetInstallStatus() ApplicationAssemblyPhase
GetInstallStatus returns the install phase for addon
func (*Addon) GetPackageSpec ¶
func (a *Addon) GetPackageSpec() PackageSpec
GetPackageSpec returns the addon package details from addon spec
func (*Addon) GetPrereqStatus ¶
func (a *Addon) GetPrereqStatus() ApplicationAssemblyPhase
GetPrereqStatus returns the prereq phase for addon
func (*Addon) GetWorkflowType ¶
func (a *Addon) GetWorkflowType(step LifecycleStep) (*WorkflowType, error)
GetWorkflowType returns the WorkflowType under the addon lifecycle spec
func (*Addon) SetInstallStatus ¶
func (a *Addon) SetInstallStatus(phase ApplicationAssemblyPhase, reasons ...string)
SetInstallStatus sets the install phase for addon
func (*Addon) SetPrereqAndInstallStatuses ¶
func (a *Addon) SetPrereqAndInstallStatuses(phase ApplicationAssemblyPhase, reasons ...string) error
SetPrereqAndInstallStatuses sets the prereq and install phases for addon
func (*Addon) SetStatusByLifecyleStep ¶
func (a *Addon) SetStatusByLifecyleStep(step LifecycleStep, phase ApplicationAssemblyPhase, reasons ...string) error
type AddonList ¶
type AddonList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Addon `json:"items"`
}
+kubebuilder:object:root=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object AddonList contains a list of Addon
func (*AddonList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonList.
func (*AddonList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AddonList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AddonOverridesSpec ¶
type AddonOverridesSpec struct {
// Kustomize specs
// +optional
Kustomize KustomizeSpec `json:"kustomize,omitempty"`
// Template specs
// +optional
Template map[string]string `json:"template,omitempty" protobuf:"bytes,2,rep,name=template"`
}
AddonOverridesSpec represents a template of the resources that can be deployed or patched alongside the main deployment
func (*AddonOverridesSpec) DeepCopy ¶
func (in *AddonOverridesSpec) DeepCopy() *AddonOverridesSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonOverridesSpec.
func (*AddonOverridesSpec) DeepCopyInto ¶
func (in *AddonOverridesSpec) DeepCopyInto(out *AddonOverridesSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AddonParams ¶
type AddonParams struct {
// +kubebuilder:validation:MinLength=1
Namespace string `json:"namespace,omitempty"`
// Context values passed directly to the addon
// +optional
Context ClusterContext `json:"context,omitempty"`
// Data values that will be parameters injected into workflows
// +optional
Data map[string]FlexString `json:"data,omitempty"`
}
AddonParams are the parameters which will be available to the template workflows
func (*AddonParams) DeepCopy ¶
func (in *AddonParams) DeepCopy() *AddonParams
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonParams.
func (*AddonParams) DeepCopyInto ¶
func (in *AddonParams) DeepCopyInto(out *AddonParams)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AddonSpec ¶
type AddonSpec struct {
PackageSpec `json:",inline"`
// Parameters that will be injected into the workflows for addon
// +optional
Params AddonParams `json:"params,omitempty"`
// Selector that is used to filter the resource watching
// +optional
Selector metav1.LabelSelector `json:"selector,omitempty"`
// Overrides are kustomize patches that can be applied to templates
// +optional
Overrides AddonOverridesSpec `json:"overrides,omitempty"`
// Secrets is a list of secret names expected to exist in the target namespace
// +optional
Secrets []SecretCmdSpec `json:"secrets,omitempty"`
// +optional
Lifecycle LifecycleWorkflowSpec `json:"lifecycle,omitempty"`
}
AddonSpec defines the desired state of Addon
func (*AddonSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonSpec.
func (*AddonSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AddonStatus ¶
type AddonStatus struct {
Checksum string `json:"checksum"`
Lifecycle AddonStatusLifecycle `json:"lifecycle"`
Resources []ObjectStatus `json:"resources"`
Reason string `json:"reason"`
StartTime int64 `json:"starttime"`
}
AddonStatus defines the observed state of Addon
func (*AddonStatus) DeepCopy ¶
func (in *AddonStatus) DeepCopy() *AddonStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonStatus.
func (*AddonStatus) DeepCopyInto ¶
func (in *AddonStatus) DeepCopyInto(out *AddonStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AddonStatusLifecycle ¶
type AddonStatusLifecycle struct {
Prereqs ApplicationAssemblyPhase `json:"prereqs,omitempty"`
Installed ApplicationAssemblyPhase `json:"installed,omitempty"`
}
AddonStatusLifecycle defines the lifecycle status for steps.
func (*AddonStatusLifecycle) DeepCopy ¶
func (in *AddonStatusLifecycle) DeepCopy() *AddonStatusLifecycle
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonStatusLifecycle.
func (*AddonStatusLifecycle) DeepCopyInto ¶
func (in *AddonStatusLifecycle) DeepCopyInto(out *AddonStatusLifecycle)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ApplicationAssemblyPhase ¶
type ApplicationAssemblyPhase string
ApplicationAssemblyPhase tracks the Addon CRD phases: pending, succeeded, failed, deleting, deleteFailed
const ( // Pending Used to indicate that not all of application's components have been deployed yet. Pending ApplicationAssemblyPhase = "Pending" // Succeeded Used to indicate that all of application's components have already been deployed. Succeeded ApplicationAssemblyPhase = "Succeeded" // Failed Used to indicate that deployment of application's components failed. Some components // might be present, but deployment of the remaining ones will not be re-attempted. Failed ApplicationAssemblyPhase = "Failed" // ValidationFailed Used to indicate validation failed ValidationFailed ApplicationAssemblyPhase = "Validation Failed" // Deleting Used to indicate that all application's components are being deleted. Deleting ApplicationAssemblyPhase = "Deleting" // DeleteFailed Used to indicate that delete failed. DeleteFailed ApplicationAssemblyPhase = "Delete Failed" // DeleteSucceeded Used to indicate that delete succeeded. DeleteSucceeded ApplicationAssemblyPhase = "Delete Succeeded" )
Constants
func (ApplicationAssemblyPhase) Completed ¶
func (p ApplicationAssemblyPhase) Completed() bool
func (ApplicationAssemblyPhase) Deleting ¶
func (p ApplicationAssemblyPhase) Deleting() bool
func (ApplicationAssemblyPhase) Failed ¶
func (p ApplicationAssemblyPhase) Failed() bool
func (ApplicationAssemblyPhase) Running ¶
func (p ApplicationAssemblyPhase) Running() bool
func (ApplicationAssemblyPhase) Succeeded ¶
func (p ApplicationAssemblyPhase) Succeeded() bool
type ClusterContext ¶
type ClusterContext struct {
// ClusterName name of the cluster
// +optional
ClusterName string `json:"clusterName,omitempty"`
// ClusterRegion region of the cluster
// +optional
ClusterRegion string `json:"clusterRegion,omitempty"`
// AdditionalConfigs are a map of string values that correspond to additional context data that can be passed along
// +optional
AdditionalConfigs map[string]FlexString `json:"additionalConfigs,omitempty" protobuf:"bytes,2,rep,name=data"`
}
ClusterContext represents a minimal context that can be provided to an addon
func (*ClusterContext) DeepCopy ¶
func (in *ClusterContext) DeepCopy() *ClusterContext
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterContext.
func (*ClusterContext) DeepCopyInto ¶
func (in *ClusterContext) DeepCopyInto(out *ClusterContext)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DeploymentPhase ¶
type DeploymentPhase string
DeploymentPhase represents the status of observed resources
const ( // InProgress deployment phase for resources in addon InProgress DeploymentPhase = "InProgress" // Ready deployment phase for resources in addon Ready DeploymentPhase = "Ready" // Unknown deployment phase for resources in addon Unknown DeploymentPhase = "Unknown" )
type FlexString ¶
type FlexString string
FlexString is a ptr to string type that is used to provide additional configs
func (*FlexString) UnmarshalJSON ¶
func (fs *FlexString) UnmarshalJSON(b []byte) error
UnmarshalJSON overrides unmarshaler.UnmarshalJSON in converter
type KustomizeSpec ¶
type KustomizeSpec struct {
// Common labels as per Kustomize spec
// +optional
Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,1,rep,name=labels"`
// Common annotations as per Kustomize spec
// +optional
Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,1,rep,name=annotations"`
// List of resource kinds
// +optional
Resources []string `json:"resources,omitempty"`
// Overlay templates, these are patch objects as per kustomize spec
// +optional
Overlay KustomizeTemplate `json:"overlay,omitempty"`
}
KustomizeSpec is used to specify common Kustomize spec features
func (*KustomizeSpec) DeepCopy ¶
func (in *KustomizeSpec) DeepCopy() *KustomizeSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizeSpec.
func (*KustomizeSpec) DeepCopyInto ¶
func (in *KustomizeSpec) DeepCopyInto(out *KustomizeSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KustomizeTemplate ¶
type KustomizeTemplate struct {
// Template patch yamls as per Kustomize spec
// +optional
Template map[string]string `json:"template,omitempty" protobuf:"bytes,2,rep,name=template"`
}
KustomizeTemplate is used to specify override patch templates in Kustomize format
func (*KustomizeTemplate) DeepCopy ¶
func (in *KustomizeTemplate) DeepCopy() *KustomizeTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizeTemplate.
func (*KustomizeTemplate) DeepCopyInto ¶
func (in *KustomizeTemplate) DeepCopyInto(out *KustomizeTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LifecycleStep ¶
type LifecycleStep string
LifecycleStep is a string representation of the lifecycle steps available in Addon spec: prereqs, install, delete, validate
const ( // Prereqs constant Prereqs LifecycleStep = "prereqs" // Install constant Install LifecycleStep = "install" // Delete constant Delete LifecycleStep = "delete" // Validate constant Validate LifecycleStep = "validate" )
type LifecycleWorkflowSpec ¶
type LifecycleWorkflowSpec struct {
Prereqs WorkflowType `json:"prereqs,omitempty"`
Install WorkflowType `json:"install,omitempty"`
Delete WorkflowType `json:"delete,omitempty"`
Validate WorkflowType `json:"validate,omitempty"`
}
LifecycleWorkflowSpec is where all of the lifecycle workflow templates will be specified under
func (*LifecycleWorkflowSpec) DeepCopy ¶
func (in *LifecycleWorkflowSpec) DeepCopy() *LifecycleWorkflowSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LifecycleWorkflowSpec.
func (*LifecycleWorkflowSpec) DeepCopyInto ¶
func (in *LifecycleWorkflowSpec) DeepCopyInto(out *LifecycleWorkflowSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ObjectStatus ¶
type ObjectStatus struct {
// Link to object
Link string `json:"link,omitempty"`
// Name of object
Name string `json:"name,omitempty"`
// Kind of object
Kind string `json:"kind,omitempty"`
// Object group
Group string `json:"group,omitempty"`
// Status. Values: InProgress, Ready, Unknown
Status string `json:"status,omitempty"`
}
ObjectStatus is a generic status holder for objects +k8s:deepcopy-gen=true
func (*ObjectStatus) DeepCopy ¶
func (in *ObjectStatus) DeepCopy() *ObjectStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStatus.
func (*ObjectStatus) DeepCopyInto ¶
func (in *ObjectStatus) DeepCopyInto(out *ObjectStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PackageSpec ¶
type PackageSpec struct {
PkgChannel string `json:"pkgChannel,omitempty"`
PkgName string `json:"pkgName"`
PkgVersion string `json:"pkgVersion"`
PkgType PackageType `json:"pkgType"`
PkgDescription string `json:"pkgDescription"`
PkgDeps map[string]string `json:"pkgDeps,omitempty"`
}
PackageSpec is the package level details needed by addon
func (*PackageSpec) DeepCopy ¶
func (in *PackageSpec) DeepCopy() *PackageSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PackageSpec.
func (*PackageSpec) DeepCopyInto ¶
func (in *PackageSpec) DeepCopyInto(out *PackageSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PackageType ¶
type PackageType string
PackageType is a specific deployer type that will be used for deploying templates
const ( // HelmPkg is a deployer package type representing Helm package structure HelmPkg PackageType = "helm" // ShipPkg is a deployer package type representing Ship package structure ShipPkg PackageType = "ship" // KustomizePkg is a deployer package type representing Kustomize package structure KustomizePkg PackageType = "kustomize" // CnabPkg is a deployer package type representing CNAB package structure CnabPkg PackageType = "cnab" // CompositePkg is a package type representing a composite package structure, just yamls CompositePkg PackageType = "composite" )
type SecretCmdSpec ¶
type SecretCmdSpec struct {
Name string `json:"name"`
Cmd CmdType `json:"cmd,omitempty"`
Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"`
}
SecretCmdSpec is a secret list and/or generator for secrets using the available commands: random, cert.
func (*SecretCmdSpec) DeepCopy ¶
func (in *SecretCmdSpec) DeepCopy() *SecretCmdSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretCmdSpec.
func (*SecretCmdSpec) DeepCopyInto ¶
func (in *SecretCmdSpec) DeepCopyInto(out *SecretCmdSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkflowType ¶
type WorkflowType struct {
// NamePrefix is a prefix for the name of workflow
// +kubebuilder:validation:MaxLength=10
// +optional
NamePrefix string `json:"namePrefix,omitempty"`
// Role used to denote the role annotation that should be used by the deployment resource
// +optional
Role string `json:"role,omitempty"`
// WorkflowRole used to denote the role annotation that should be used by the workflow
// +optional
WorkflowRole string `json:"workflowRole,omitempty"`
// Template is used to provide the workflow spec
Template string `json:"template"`
}
WorkflowType allows user to specify workflow templates with optional namePrefix, workflowRole or role.
func (*WorkflowType) DeepCopy ¶
func (in *WorkflowType) DeepCopy() *WorkflowType
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowType.
func (*WorkflowType) DeepCopyInto ¶
func (in *WorkflowType) DeepCopyInto(out *WorkflowType)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.