Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Params ¶
type Params struct {
// Dir is the name of the directory where the files of the resource
// should be generated.
Dir string
// Language is the primary language of the target repository (e.g. "go", "generic").
Language string
// Flavors is a list of additional checker flavors to include (e.g. "bash", "md", "helmchart").
Flavors []string
// RepoName is the name of the repository under giantswarm organization (e.g. "devctl").
RepoName string
// WorkingDir is the root directory of the repository (used for detecting helm charts).
WorkingDir string
// HelmCharts is the list of helm chart names discovered under helm/ in WorkingDir.
HelmCharts []string
// K8sSchemaVersion is the Kubernetes JSON schema version used in helm chart .schema.yaml.
K8sSchemaVersion string
// NodeRunPrefix is the package-manager script-run prefix ("npm run" /
// "yarn run" / "pnpm run") the dev-only Node lint hook invokes. Set only
// when NodeDevLintHook is true; detected from the lockfile.
NodeRunPrefix string
// GoGenerate runs `go generate ./...` in the pre-commit job before the hooks
// (Go only). Opt-in, because the job installs no code generators: a repo
// whose directives need controller-gen or mockgen would fail the step. Set
// it for a repo that does not compile from a clean checkout, such as one
// embedding a file `go generate` writes.
GoGenerate bool
// NodeDevLintHook turns on the dev-only pre-push `ci:lint` hook (Node only).
// The hook runs the repo's standard `ci:lint` script -- a single convention
// name, like ci:verify/ci:build, that the repo defines pointing at its own
// eslint/prettier toolchain. No per-script knob: the repo converges its
// scripts to the convention, the generator does not bend to the repo.
NodeDevLintHook bool
// HelmValuesSchemaJSONVersion and SchemalintVersion pin the generated helm-schema
// hook's `additional_dependencies`. Read from devctl's own build info (go.mod is
// the single source of truth) rather than hardcoded in the template, so the hook
// always installs the exact versions devctl itself uses to generate
// values.schema.json. Set only when the helmchart flavor is active.
HelmValuesSchemaJSONVersion string
SchemalintVersion string
// HelmVersion pins the helm binary the helm-schema hook of a chart with a
// SchemaDependency installs to fetch it. Set only when the helmchart flavor is active.
HelmVersion string
// SchemaDependencies maps a chart name to the dependency its .schema.yaml names in
// schemaRoot.ref. A chart without a schemaRoot.ref has no entry.
SchemaDependencies map[string]SchemaDependency
}
type SchemaDependency ¶
type SchemaDependency struct {
// Ref is schemaRoot.ref, relative to the chart directory, which is where
// helm-values-schema-json resolves it from.
Ref string
// Name is the dependency's chart name, which its package unpacks to.
Name string
// Dir is the dependency's directory below charts/, relative to the repository root,
// with forward slashes: its alias when it has one, else its name.
Dir string
// Archive is the dependency's chart package, nil when the dependency is not fetched.
Archive []byte
// SourceDir is the directory of a file:// dependency, relative to the repository
// root, with forward slashes.
SourceDir string
}
SchemaDependency is the dependency of a chart whose values schema the chart's .schema.yaml references at its root: schemaRoot.ref is charts/<dependency>/<path>.
Click to show internal directories.
Click to hide internal directories.