common

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package common defines flags and options shared by every Deployah command.

GlobalOptions captures persistent CLI flags such as namespace, kubeconfig, spec path, debug mode, and operation timeout. The root command reads these values in its pre-run hook and builds a runtime.Runtime from them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterHint added in v0.4.0

func ClusterHint(err error) string

ClusterHint returns an actionable suffix for errors that look like the target cluster or context is missing or unreachable. It returns an empty string for unrelated errors. Shared by `deployah deploy` and `deployah plan` so their connectivity error messages never drift apart.

func HasExposeComponents added in v0.4.0

func HasExposeComponents(m *spec.Spec) bool

HasExposeComponents reports whether any component in the spec declares an expose block, meaning platform resolution is required.

func MaterializeSelfSignedTLS added in v0.4.0

func MaterializeSelfSignedTLS(ctx context.Context, k8sClient kubernetes.Interface, k8sErr error, namespace string, resolved *spec.ResolvedSpec) error

MaterializeSelfSignedTLS fetches or generates the self-signed TLS certificate for every resolved component before any chart render, so all renders in the invocation see identical certificate bytes. Fails closed when k8sErr is non-nil and a selfSigned component exists, rather than rotating a live secret on a transient clientset failure; pass a nil k8sClient with a nil k8sErr to force offline generation deliberately.

func WarnContextFallback added in v0.4.0

func WarnContextFallback(c *nabat.Context, cluster *session.Cluster, env string)

WarnContextFallback warns when cluster follows the kubeconfig current-context because neither --context nor a platform context named one, so a wrong-cluster operation is visible before it happens.

Types

type GlobalOptions

type GlobalOptions struct {
	Namespace    string        `nabat:"namespace"`
	Kubeconfig   string        `nabat:"kubeconfig"`
	Context      string        `nabat:"context"`
	Spec         string        `nabat:"spec"`
	PlatformFile string        `nabat:"platform-file"`
	Debug        bool          `nabat:"debug"`
	Timeout      time.Duration `nabat:"timeout"`
}

GlobalOptions are the persistent flags shared by all commands. Used exclusively in the OnPreRun hook to construct the runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL