Documentation ¶
Index ¶
Constants ¶
const ( // HelmChartsDir is the relative directory within an SDK project where Helm // charts are stored. HelmChartsDir string = "helm-charts" // DefaultAPIVersion is the Kubernetes CRD API Version used for fetched // charts when the --api-version flag is not specified DefaultAPIVersion string = "charts.helm.k8s.io/v1alpha1" )
const WatchesYamlFile = "watches.yaml"
Variables ¶
This section is empty.
Functions ¶
func CreateChart ¶
func CreateChart(projectDir string, opts CreateChartOptions) (*scaffold.Resource, *chart.Chart, error)
CreateChart scaffolds a new helm chart for the project rooted in projectDir based on the passed opts.
It returns a scaffold.Resource that can be used by the caller to create other related files. opts.ResourceAPIVersion and opts.ResourceKind are used to create the resource and must be specified if opts.Chart is empty.
If opts.Chart is not empty, opts.ResourceAPIVersion and opts.Kind can be left unset: opts.ResourceAPIVersion defaults to "charts.helm.k8s.io/v1alpha1" and opts.ResourceKind is deduced from the specified opts.Chart.
CreateChart also returns a chart.Chart that references the newly created chart.
If opts.Chart is empty, CreateChart scaffolds the default chart from helm's default template.
If opts.Chart is a local file, CreateChart verifies that it is a valid helm chart archive and unpacks it into the project's helm charts directory.
If opts.Chart is a local directory, CreateChart verifies that it is a valid helm chart directory and copies it into the project's helm charts directory.
For any other value of opts.Chart, CreateChart attempts to fetch the helm chart from a remote repository.
If opts.Repo is not specified, the following chart reference formats are supported:
<repoName>/<chartName>: Fetch the helm chart named chartName from the helm chart repository named repoName, as specified in the $HELM_HOME/repositories/repositories.yaml file.
<url>: Fetch the helm chart archive at the specified URL.
If opts.Repo is specified, only one chart reference format is supported:
- <chartName>: Fetch the helm chart named chartName in the helm chart repository specified by opts.Repo
If opts.Version is not set, CreateChart will fetch the latest available version of the helm chart. Otherwise, CreateChart will fetch the specified version. opts.Version is not used when opts.Chart itself refers to a specific version, for example when it is a local path or a URL.
CreateChart returns an error if an error occurs creating the scaffold.Resource or creating the chart.
Types ¶
type CreateChartOptions ¶
type CreateChartOptions struct { // ResourceAPIVersion defines the Kubernetes GroupVersion to be associated // with the created chart. ResourceAPIVersion string // ResourceKind defines the Kubernetes Kind to be associated with the // created chart. ResourceKind string // Chart is a chart reference for a local or remote chart. Chart string // Repo is a URL to a custom chart repository. Repo string // Version is the version of the chart to fetch. Version string }
CreateChartOptions is used to configure how a Helm chart is scaffolded for a new Helm operator project.
type Dockerfile ¶
Dockerfile specifies the Helm Dockerfile scaffold
type DockerfileHybrid ¶
type DockerfileHybrid struct { input.Input // HelmCharts - if true, include a COPY statement for the helm-charts directory HelmCharts bool // Watches - if true, include a COPY statement for watches.yaml Watches bool }
DockerfileHybrid - Dockerfile for a hybrid operator
type Entrypoint ¶
Entrypoint - entrypoint script