kubernetes

package
v1.522.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractImagesFromManifests added in v1.522.0

func ExtractImagesFromManifests(manifests []byte) ([]string, error)

ExtractImagesFromManifests parses a multi-doc YAML byte stream (as produced by `helm template`) and returns every non-placeholder value of any `image` key, deduplicated in first-seen order. It covers container/initContainer specs at any depth (Deployment, StatefulSet, DaemonSet, Job, CronJob, ...) by recursively walking each document rather than relying on typed structs.

Decoding uses yaml.Node so that document/key order is preserved — a plain map[string]interface{} would lose ordering and make the result depend on Go's randomized map iteration.

func GetChartInfo added in v1.204.0

func GetChartInfo(chartYamlFile string, utils DeployUtils) (string, string, error)

GetChartInfo is used to get name and version of helm chart

Types

type DeployUtils

type DeployUtils interface {
	SetEnv(env []string)
	Stdout(out io.Writer)
	Stderr(err io.Writer)
	RunExecutable(e string, p ...string) error

	piperutils.FileUtils
	piperhttp.Uploader
	piperhttp.Downloader
}

DeployUtils interface

func NewDeployUtilsBundle

func NewDeployUtilsBundle(customTLSCertificateLinks []string) DeployUtils

NewDeployUtilsBundle initialize using deployUtilsBundle struct

type HelmExecute

type HelmExecute struct {
	// contains filtered or unexported fields
}

HelmExecute struct

func (*HelmExecute) RunHelmDependency added in v1.210.0

func (h *HelmExecute) RunHelmDependency() error

RunHelmDependency is used to manage a chart's dependencies

func (*HelmExecute) RunHelmInstall

func (h *HelmExecute) RunHelmInstall() error

RunHelmInstall is used to install a chart

func (*HelmExecute) RunHelmLint

func (h *HelmExecute) RunHelmLint() error

RunHelmLint is used to examine a chart for possible issues

func (*HelmExecute) RunHelmPublish added in v1.204.0

func (h *HelmExecute) RunHelmPublish() (string, error)

RunHelmPublish is used to upload a chart to a registry

func (*HelmExecute) RunHelmTemplate added in v1.522.0

func (h *HelmExecute) RunHelmTemplate() ([]byte, error)

RunHelmTemplate renders the chart locally (`helm template`) and returns the rendered multi-document manifest YAML captured from stdout. Used for SBOM image discovery. Stdout is temporarily redirected to a buffer for the duration of the call, then restored.

func (*HelmExecute) RunHelmTest

func (h *HelmExecute) RunHelmTest() error

RunHelmTest is used to run tests for a release

func (*HelmExecute) RunHelmUninstall

func (h *HelmExecute) RunHelmUninstall() error

RunHelmUninstall is used to uninstall a chart

func (*HelmExecute) RunHelmUpgrade

func (h *HelmExecute) RunHelmUpgrade() error

RunHelmUpgrade is used to upgrade a release

type HelmExecuteOptions

type HelmExecuteOptions struct {
	AdditionalParameters      []string `json:"additionalParameters,omitempty"`
	ChartPath                 string   `json:"chartPath,omitempty"`
	DeploymentName            string   `json:"deploymentName,omitempty"`
	ForceUpdates              bool     `json:"forceUpdates,omitempty"`
	HelmDeployWaitSeconds     int      `json:"helmDeployWaitSeconds,omitempty"`
	HelmValues                []string `json:"helmValues,omitempty"`
	Image                     string   `json:"image,omitempty"`
	KeepFailedDeployments     bool     `json:"keepFailedDeployments,omitempty"`
	KubeConfig                string   `json:"kubeConfig,omitempty"`
	KubeContext               string   `json:"kubeContext,omitempty"`
	Namespace                 string   `json:"namespace,omitempty"`
	DockerConfigJSON          string   `json:"dockerConfigJSON,omitempty"`
	Version                   string   `json:"version,omitempty"`
	AppVersion                string   `json:"appVersion,omitempty"`
	PublishVersion            string   `json:"publishVersion,omitempty"`
	Dependency                string   `json:"dependency,omitempty" validate:"possible-values=build list update"`
	PackageDependencyUpdate   bool     `json:"packageDependencyUpdate,omitempty"`
	DumpLogs                  bool     `json:"dumpLogs,omitempty"`
	FilterTest                string   `json:"filterTest,omitempty"`
	TargetRepositoryURL       string   `json:"targetRepositoryURL,omitempty"`
	TargetRepositoryName      string   `json:"targetRepositoryName,omitempty"`
	TargetRepositoryUser      string   `json:"targetRepositoryUser,omitempty"`
	TargetRepositoryPassword  string   `json:"targetRepositoryPassword,omitempty"`
	SourceRepositoryURL       string   `json:"sourceRepositoryURL,omitempty"`
	SourceRepositoryName      string   `json:"sourceRepositoryName,omitempty"`
	SourceRepositoryUser      string   `json:"sourceRepositoryUser,omitempty"`
	SourceRepositoryPassword  string   `json:"sourceRepositoryPassword,omitempty"`
	HelmCommand               string   `json:"helmCommand,omitempty"`
	CustomTLSCertificateLinks []string `json:"customTlsCertificateLinks,omitempty"`
	RenderSubchartNotes       bool     `json:"renderSubchartNotes,omitempty"`
}

HelmExecuteOptions struct holds common parameters for functions RunHelm...

type HelmExecutor

type HelmExecutor interface {
	RunHelmUpgrade() error
	RunHelmLint() error
	RunHelmInstall() error
	RunHelmUninstall() error
	RunHelmTest() error
	RunHelmPublish() (string, error)
	RunHelmDependency() error
	RunHelmTemplate() ([]byte, error)
}

HelmExecutor is used for mock

func NewHelmExecutor

func NewHelmExecutor(config HelmExecuteOptions, utils DeployUtils, verbose bool, stdout io.Writer) HelmExecutor

NewHelmExecutor creates HelmExecute instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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