Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AutoResolveVersionOnce is intend to indicate captain that once it resolve a latest version for this HelmRequest, // in the following updates, skip auto-resolve the version again. AutoResolveVersionOnce = "auto-resolve-version-once" )
View Source
var CRD = &extensionsobj.CustomResourceDefinition{ ObjectMeta: metav1.ObjectMeta{ Name: "helmrequests." + v1alpha1.SchemeGroupVersion.Group, }, TypeMeta: metav1.TypeMeta{ Kind: "CustomResourceDefinition", APIVersion: "apiextensions.k8s.io/v1beta1", }, Spec: extensionsobj.CustomResourceDefinitionSpec{ Group: v1alpha1.SchemeGroupVersion.Group, Version: v1alpha1.SchemeGroupVersion.Version, Scope: extensionsobj.ResourceScope("Namespaced"), Names: extensionsobj.CustomResourceDefinitionNames{ Plural: "helmrequests", Singular: "helmrequest", Kind: "HelmRequest", ListKind: "HelmRequestList", ShortNames: []string{"hr"}, Categories: []string{"all"}, }, AdditionalPrinterColumns: []extensionsobj.CustomResourceColumnDefinition{ { Name: "Chart", Type: "string", JSONPath: ".spec.chart", }, { Name: "Version", Type: "string", JSONPath: ".spec.version", }, { Name: "Namespace", Type: "string", JSONPath: ".spec.namespace", }, { Name: "AllCluster", Type: "boolean", JSONPath: ".spec.installToAllClusters", }, { Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp", }, { Name: "Phase", Type: "string", JSONPath: ".status.phase", }, }, Subresources: &extensionsobj.CustomResourceSubresources{ Status: &extensionsobj.CustomResourceSubresourceStatus{}, }, Validation: &extensionsobj.CustomResourceValidation{ OpenAPIV3Schema: &extensionsobj.JSONSchemaProps{ Properties: map[string]extensionsobj.JSONSchemaProps{ "spec": { Required: []string{ "chart", }, Properties: map[string]extensionsobj.JSONSchemaProps{ "values": { Type: "object", Nullable: true, }, }, }, }, }, }, }, }
CRD is the CRD definition for HelmRequest CRD file and example is in $CAPTAIN_ROOT/artifacts/crd/*.yaml
Functions ¶
func EnsureCRDCreated ¶
EnsureCRDCreated tries to create/update CRD, returns (true, nil) if succeeding, otherwise returns (false, nil). 'err' should always be nil, because it is used by wait.PollUntil(), and it will exit if it is not nil.
func ResolveVersion ¶ added in v1.3.1
func ResolveVersion(hr *v1alpha1.HelmRequest) string
ResolveVersion resolve helmrequest version for install.
- If hr.spec.version is not empty, use it
- If hr.spec.version is empty a. If annotations.auto-resolve-version-once=false, auto resolve version every time from chartrepo b. If annotations.auto-resolve-version-once=true, auto resolve version in the first time, then use the version from .status.verion
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.