Documentation
¶
Overview ¶
Package components reads and mutates the platform-components HelmRelease in a Podplane cluster, which is the single source of truth for which Podplane component charts are enabled/installed and which are core.
Index ¶
- Constants
- func RecommendedAddons() []string
- func SetEnabled(ctx context.Context, kubeContext, kubeconfig string, apps, crds []string, ...) error
- type Config
- func (c *Config) EnabledDependents(name string) []string
- func (c *Config) Get(name string) (entry Entry, isApp bool, ok bool)
- func (c *Config) Has(name string) bool
- func (c *Config) HelmReleaseRefs(plan EnableSet) []health.HelmReleaseRef
- func (c *Config) ResolveEnable(name string) (EnableSet, error)
- type EnableSet
- type Entry
- type HelmError
Constants ¶
const ( HelmReleaseName = "platform-components" HelmReleaseNamespace = "platform-components" )
Helm release coordinates for the platform-components release that is the runtime source of truth for which components are enabled.
Variables ¶
This section is empty.
Functions ¶
func RecommendedAddons ¶
func RecommendedAddons() []string
RecommendedAddons returns addon components included by the recommended platform-components seed.
func SetEnabled ¶
func SetEnabled(ctx context.Context, kubeContext, kubeconfig string, apps, crds []string, enabled bool) error
SetEnabled patches the platform-components HelmRelease so the given apps and CRDs have spec.values.platform.components.{apps,crds}.<name>.enabled set to the given value. Empty lists are no-ops. kubeContext and kubeconfig are optional; empty values use kubectl's defaults.
Types ¶
type Config ¶
Config is a snapshot of the platform-components Helm release values that determine which Podplane components are enabled in a cluster.
func Read ¶
Read returns the platform-components Helm release values, merging chart defaults with any overrides applied by the platform-components HelmRelease. This is what makes `core: true` (declared as a chart default in podplane/components) visible to the CLI even though the HelmRelease only stores user overrides.
kubeContext and kubeconfig are optional; empty values use helm's defaults.
func (*Config) EnabledDependents ¶
EnabledDependents returns the names of currently enabled apps and CRDs whose dependsOn list contains name. Used by uninstall to refuse removing a component that other enabled components depend on.
func (*Config) Get ¶
Get returns the entry for name. isApp is true when the entry is an app chart, false when it is a CRD chart. ok is false when name is not present.
func (*Config) HelmReleaseRefs ¶ added in v0.2.0
func (c *Config) HelmReleaseRefs(plan EnableSet) []health.HelmReleaseRef
HelmReleaseRefs builds runtime HelmRelease references for every app and CRD in an enable plan.
func (*Config) ResolveEnable ¶
ResolveEnable walks dependsOn transitively to compute the apps and CRDs that must be flipped to enabled=true so that name can be installed.
The returned set excludes entries that are already enabled. If name itself is already enabled and all of its (transitive) dependencies are too, the returned set is empty.
ResolveEnable returns an error when name is not present in the cluster's platform-components values, or when any (transitive) dependency cannot be found there.
type EnableSet ¶
EnableSet is the set of apps and CRDs that must be enabled to install a component. Names are sorted alphabetically.
type Entry ¶
Entry describes one component (app or CRD chart) entry as read from the platform-components Helm release values.