action

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: Apache-2.0 Imports: 74 Imported by: 17

Documentation

Index

Constants

View Source
const (
	LogColorModeAuto = "auto"
	LogColorModeOff  = "off"
	LogColorModeOn   = "on"
)
View Source
const (
	ReleaseStorageDriverDefault    = ""
	ReleaseStorageDriverSecrets    = "secrets"
	ReleaseStorageDriverSecret     = "secret"
	ReleaseStorageDriverConfigMaps = "configmaps"
	ReleaseStorageDriverConfigMap  = "configmap"
	ReleaseStorageDriverMemory     = "memory"
	ReleaseStorageDriverSQL        = "sql"
)
View Source
const (
	YamlOutputFormat  = "yaml"
	JsonOutputFormat  = "json"
	TableOutputFormat = "table"
)
View Source
const (
	SilentLogLevel  = string(log.SilentLevel)
	ErrorLogLevel   = string(log.ErrorLevel)
	WarningLogLevel = string(log.WarningLevel)
	InfoLogLevel    = string(log.InfoLevel)
	DebugLogLevel   = string(log.DebugLevel)
	TraceLogLevel   = string(log.TraceLevel)
)
View Source
const (
	DefaultQPSLimit              = 30
	DefaultBurstLimit            = 100
	DefaultNetworkParallelism    = 30
	DefaultLocalKubeVersion      = "1.20.0"
	DefaultProgressPrintInterval = 5 * time.Second
	DefaultReleaseHistoryLimit   = 10
	DefaultLogColorMode          = LogColorModeAuto

	StubReleaseName      = "stub-release"
	StubReleaseNamespace = "stub-namespace"
)
View Source
const (
	DefaultReleaseGetOutputFormat = YamlOutputFormat
	DefaultReleaseGetLogLevel     = ErrorLogLevel
)
View Source
const (
	DefaultReleaseListOutputFormat = TableOutputFormat
	DefaultReleaseListLogLevel     = ErrorLogLevel
)
View Source
const (
	DefaultVersionOutputFormat = YamlOutputFormat
	DefaultVersionLogLevel     = ErrorLogLevel
)
View Source
const ChartRenderResultApiVersionV1 = "v1"
View Source
const (
	DefaultChartLintLogLevel = InfoLogLevel
)
View Source
const (
	DefaultChartRenderLogLevel = ErrorLogLevel
)
View Source
const (
	DefaultLegacyReleaseUninstallLogLevel = InfoLogLevel
)
View Source
const (
	DefaultReleaseInstallLogLevel = InfoLogLevel
)
View Source
const (
	DefaultReleasePlanInstallLogLevel = InfoLogLevel
)
View Source
const (
	DefaultReleaseRollbackLogLevel = InfoLogLevel
)
View Source
const (
	DefaultReleaseUninstallLogLevel = InfoLogLevel
)
View Source
const (
	DefaultSecretFileDecryptLogLevel = ErrorLogLevel
)
View Source
const (
	DefaultSecretFileEditLogLevel = ErrorLogLevel
)
View Source
const (
	DefaultSecretFileEncryptLogLevel = ErrorLogLevel
)
View Source
const (
	DefaultSecretKeyCreateLogLevel = ErrorLogLevel
)
View Source
const (
	DefaultSecretKeyRotateLogLevel = InfoLogLevel
)
View Source
const (
	DefaultSecretValuesFileDecryptLogLevel = ErrorLogLevel
)
View Source
const (
	DefaultSecretValuesFileEditLogLevel = ErrorLogLevel
)
View Source
const (
	DefaultSecretValuesFileEncryptLogLevel = ErrorLogLevel
)
View Source
const ReleaseGetResultApiVersionV1 = "v1"
View Source
const ReleaseListResultApiVersionV1 = "v1"

Variables

View Source
var DefaultRegistryCredentialsPath = filepath.Join(homedir.Get(), ".docker", config.ConfigFileName)
View Source
var ErrChangesPlanned = errors.New("changes planned")
View Source
var LogLevels []string = lo.Map(log.Levels, func(lvl log.Level, _ int) string {
	return string(lvl)
})

Functions

func ChartLint

func ChartLint(ctx context.Context, opts ChartLintOptions) error

func LegacyReleaseUninstall added in v1.5.0

func LegacyReleaseUninstall(ctx context.Context, releaseName, releaseNamespace string, opts LegacyReleaseUninstallOptions) error

func ReleaseInstall

func ReleaseInstall(ctx context.Context, releaseName, releaseNamespace string, opts ReleaseInstallOptions) error

func ReleasePlanInstall

func ReleasePlanInstall(ctx context.Context, releaseName, releaseNamespace string, opts ReleasePlanInstallOptions) error

func ReleaseRollback

func ReleaseRollback(ctx context.Context, releaseName, releaseNamespace string, opts ReleaseRollbackOptions) error

func ReleaseUninstall

func ReleaseUninstall(ctx context.Context, releaseName, releaseNamespace string, opts ReleaseUninstallOptions) error

func SecretFileDecrypt

func SecretFileDecrypt(ctx context.Context, filePath string, opts SecretFileDecryptOptions) error

func SecretFileEdit

func SecretFileEdit(ctx context.Context, filePath string, opts SecretFileEditOptions) error

func SecretFileEncrypt

func SecretFileEncrypt(ctx context.Context, filePath string, opts SecretFileEncryptOptions) error

func SecretKeyCreate

func SecretKeyCreate(ctx context.Context, opts SecretKeyCreateOptions) (string, error)

func SecretKeyRotate

func SecretKeyRotate(ctx context.Context, opts SecretKeyRotateOptions) error

func SecretValuesFileDecrypt

func SecretValuesFileDecrypt(ctx context.Context, valuesFilePath string, opts SecretValuesFileDecryptOptions) error

func SecretValuesFileEdit

func SecretValuesFileEdit(ctx context.Context, valuesFilePath string, opts SecretValuesFileEditOptions) error

func SecretValuesFileEncrypt

func SecretValuesFileEncrypt(ctx context.Context, valuesFilePath string, opts SecretValuesFileEncryptOptions) error

func SetupLogging added in v1.1.2

func SetupLogging(ctx context.Context, logLevel string, opts SetupLoggingOptions) context.Context

Types

type ChartLintOptions

type ChartLintOptions struct {
	Chart                        string
	ChartAppVersion              string
	ChartDirPath                 string // TODO(v2): get rid
	ChartRepositoryInsecure      bool
	ChartRepositorySkipTLSVerify bool
	ChartRepositorySkipUpdate    bool
	ChartVersion                 string
	DefaultChartAPIVersion       string
	DefaultChartName             string
	DefaultChartVersion          string
	DefaultSecretValuesDisable   bool
	DefaultValuesDisable         bool
	ExtraAnnotations             map[string]string
	ExtraLabels                  map[string]string
	ExtraRuntimeAnnotations      map[string]string
	ForceAdoption                bool
	KubeAPIServerName            string
	KubeBurstLimit               int
	KubeCAPath                   string
	KubeConfigBase64             string
	KubeConfigPaths              []string
	KubeContext                  string
	KubeQPSLimit                 int
	KubeSkipTLSVerify            bool
	KubeTLSServerName            string
	KubeToken                    string
	LegacyChartType              helmopts.ChartType
	LegacyExtraValues            map[string]interface{}
	LocalKubeVersion             string
	LogRegistryStreamOut         io.Writer
	NetworkParallelism           int
	RegistryCredentialsPath      string
	ReleaseName                  string
	ReleaseNamespace             string
	ReleaseStorageDriver         string
	Remote                       bool
	SQLConnectionString          string
	SecretKey                    string
	SecretKeyIgnore              bool
	SecretValuesPaths            []string
	SecretWorkDir                string
	TempDirPath                  string
	ValuesFileSets               []string
	ValuesFilesPaths             []string
	ValuesSets                   []string
	ValuesStringSets             []string
}

type ChartRenderOptions

type ChartRenderOptions struct {
	Chart                        string
	ChartAppVersion              string
	ChartDirPath                 string // TODO(v2): get rid
	ChartRepositoryInsecure      bool
	ChartRepositorySkipTLSVerify bool
	ChartRepositorySkipUpdate    bool
	ChartVersion                 string
	DefaultChartAPIVersion       string
	DefaultChartName             string
	DefaultChartVersion          string
	DefaultSecretValuesDisable   bool
	DefaultValuesDisable         bool
	ExtraAnnotations             map[string]string
	ExtraLabels                  map[string]string
	ExtraRuntimeAnnotations      map[string]string
	ForceAdoption                bool
	KubeAPIServerName            string
	KubeBurstLimit               int
	KubeCAPath                   string
	KubeConfigBase64             string
	KubeConfigPaths              []string
	KubeContext                  string
	KubeQPSLimit                 int
	KubeSkipTLSVerify            bool
	KubeTLSServerName            string
	KubeToken                    string
	LegacyChartType              helmopts.ChartType
	LegacyExtraValues            map[string]interface{}
	LocalKubeVersion             string
	LogRegistryStreamOut         io.Writer
	NetworkParallelism           int
	OutputFilePath               string
	OutputNoPrint                bool
	RegistryCredentialsPath      string
	ReleaseName                  string
	ReleaseNamespace             string
	ReleaseStorageDriver         string
	Remote                       bool
	SQLConnectionString          string
	SecretKey                    string
	SecretKeyIgnore              bool
	SecretValuesPaths            []string
	SecretWorkDir                string
	ShowCRDs                     bool
	ShowOnlyFiles                []string
	TempDirPath                  string
	ValuesFileSets               []string
	ValuesFilesPaths             []string
	ValuesSets                   []string
	ValuesStringSets             []string
}

type ChartRenderResultV1 added in v1.4.0

type ChartRenderResultV1 struct {
	APIVersion string                   `json:"apiVersion"`
	CRDs       []map[string]interface{} `json:"crds,omitempty"`
	Hooks      []map[string]interface{} `json:"hooks,omitempty"`
	Resources  []map[string]interface{} `json:"resources,omitempty"`
}

type LegacyReleaseUninstallOptions added in v1.5.0

type LegacyReleaseUninstallOptions struct {
	NoDeleteHooks              bool
	DeleteReleaseNamespace     bool
	KubeAPIServerName          string
	KubeBurstLimit             int
	KubeCAPath                 string
	KubeConfigBase64           string
	KubeConfigPaths            []string
	KubeContext                string
	KubeQPSLimit               int
	KubeSkipTLSVerify          bool
	KubeTLSServerName          string
	KubeToken                  string
	NetworkParallelism         int
	ProgressTablePrintInterval time.Duration
	ReleaseHistoryLimit        int
	ReleaseStorageDriver       string
	TempDirPath                string
	Timeout                    time.Duration
}

type ReleaseGetOptions

type ReleaseGetOptions struct {
	KubeAPIServerName    string
	KubeBurstLimit       int
	KubeCAPath           string
	KubeConfigBase64     string
	KubeConfigPaths      []string
	KubeContext          string
	KubeQPSLimit         int
	KubeSkipTLSVerify    bool
	KubeTLSServerName    string
	KubeToken            string
	NetworkParallelism   int
	OutputFormat         string
	OutputNoPrint        bool
	PrintValues          bool
	ReleaseStorageDriver string
	Revision             int
	SQLConnectionString  string
	TempDirPath          string
}

type ReleaseGetResultChart

type ReleaseGetResultChart struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	AppVersion string `json:"appVersion"`
}

type ReleaseGetResultDeployedAt

type ReleaseGetResultDeployedAt struct {
	Human string `json:"human"`
	Unix  int    `json:"unix"`
}

type ReleaseGetResultRelease

type ReleaseGetResultRelease struct {
	Name          string                      `json:"name"`
	Namespace     string                      `json:"namespace"`
	Revision      int                         `json:"revision"`
	Status        helmrelease.Status          `json:"status"`
	DeployedAt    *ReleaseGetResultDeployedAt `json:"deployedAt"`
	Annotations   map[string]string           `json:"annotations"`
	StorageLabels map[string]string           `json:"storageLabels"`
}

type ReleaseGetResultV1

type ReleaseGetResultV1 struct {
	ApiVersion string                   `json:"apiVersion"`
	Release    *ReleaseGetResultRelease `json:"release"`
	Chart      *ReleaseGetResultChart   `json:"chart"`
	Notes      string                   `json:"notes,omitempty"`
	Values     map[string]interface{}   `json:"values,omitempty"`
	Hooks      []map[string]interface{} `json:"hooks,omitempty"`
	Resources  []map[string]interface{} `json:"resources,omitempty"`
}

func ReleaseGet

func ReleaseGet(ctx context.Context, releaseName, releaseNamespace string, opts ReleaseGetOptions) (*ReleaseGetResultV1, error)

type ReleaseInstallOptions

type ReleaseInstallOptions struct {
	AutoRollback                 bool
	Chart                        string
	ChartAppVersion              string
	ChartDirPath                 string // TODO(v2): get rid
	ChartRepositoryInsecure      bool
	ChartRepositorySkipTLSVerify bool
	ChartRepositorySkipUpdate    bool
	ChartVersion                 string
	DefaultChartAPIVersion       string
	DefaultChartName             string
	DefaultChartVersion          string
	DefaultSecretValuesDisable   bool
	DefaultValuesDisable         bool
	ExtraAnnotations             map[string]string
	ExtraLabels                  map[string]string
	ExtraRuntimeAnnotations      map[string]string
	ForceAdoption                bool
	InstallGraphPath             string
	InstallReportPath            string
	KubeAPIServerName            string
	KubeBurstLimit               int
	KubeCAPath                   string
	KubeConfigBase64             string
	KubeConfigPaths              []string
	KubeContext                  string
	KubeQPSLimit                 int
	KubeSkipTLSVerify            bool
	KubeTLSServerName            string
	KubeToken                    string
	LegacyChartType              helmopts.ChartType
	LegacyExtraValues            map[string]interface{}
	LogRegistryStreamOut         io.Writer
	NetworkParallelism           int
	NoInstallCRDs                bool
	NoProgressTablePrint         bool
	ProgressTablePrintInterval   time.Duration
	RegistryCredentialsPath      string
	ReleaseHistoryLimit          int
	ReleaseInfoAnnotations       map[string]string
	ReleaseLabels                map[string]string
	ReleaseStorageDriver         string
	RollbackGraphPath            string
	SQLConnectionString          string
	SecretKey                    string
	SecretKeyIgnore              bool
	SecretValuesPaths            []string
	SecretWorkDir                string
	SubNotes                     bool
	TempDirPath                  string
	Timeout                      time.Duration
	TrackCreationTimeout         time.Duration
	TrackDeletionTimeout         time.Duration
	TrackReadinessTimeout        time.Duration
	ValuesFileSets               []string
	ValuesFilesPaths             []string
	ValuesSets                   []string
	ValuesStringSets             []string
}

type ReleaseListOptions added in v1.5.0

type ReleaseListOptions struct {
	KubeAPIServerName    string
	KubeBurstLimit       int
	KubeCAPath           string
	KubeConfigBase64     string
	KubeConfigPaths      []string
	KubeContext          string
	KubeQPSLimit         int
	KubeSkipTLSVerify    bool
	KubeTLSServerName    string
	KubeToken            string
	ReleaseNamespace     string
	NetworkParallelism   int
	OutputFormat         string
	OutputNoPrint        bool
	ReleaseStorageDriver string
	SQLConnectionString  string
	TempDirPath          string
}

type ReleaseListResultChart added in v1.5.0

type ReleaseListResultChart struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	AppVersion string `json:"appVersion"`
}

type ReleaseListResultDeployedAt added in v1.5.0

type ReleaseListResultDeployedAt struct {
	Human string `json:"human"`
	Unix  int    `json:"unix"`
}

type ReleaseListResultRelease added in v1.5.0

type ReleaseListResultRelease struct {
	Name        string                       `json:"name"`
	Namespace   string                       `json:"namespace"`
	Revision    int                          `json:"revision"`
	Status      helmrelease.Status           `json:"status"`
	DeployedAt  *ReleaseListResultDeployedAt `json:"deployedAt"`
	Annotations map[string]string            `json:"annotations"`
	Chart       *ReleaseListResultChart      `json:"chart"`
}

type ReleaseListResultV1 added in v1.5.0

type ReleaseListResultV1 struct {
	ApiVersion string                      `json:"apiVersion"`
	Releases   []*ReleaseListResultRelease `json:"releases"`
}

func ReleaseList added in v1.5.0

func ReleaseList(ctx context.Context, opts ReleaseListOptions) (*ReleaseListResultV1, error)

type ReleaseNotFoundError added in v1.4.0

type ReleaseNotFoundError struct {
	ReleaseName      string
	ReleaseNamespace string
}

func (*ReleaseNotFoundError) Error added in v1.4.0

func (e *ReleaseNotFoundError) Error() string

type ReleasePlanInstallOptions

type ReleasePlanInstallOptions struct {
	Chart                        string
	ChartAppVersion              string
	ChartDirPath                 string // TODO(v2): get rid
	ChartRepositoryInsecure      bool
	ChartRepositorySkipTLSVerify bool
	ChartRepositorySkipUpdate    bool
	ChartVersion                 string
	DefaultChartAPIVersion       string
	DefaultChartName             string
	DefaultChartVersion          string
	DefaultSecretValuesDisable   bool
	DefaultValuesDisable         bool
	ErrorIfChangesPlanned        bool
	ExtraAnnotations             map[string]string
	ExtraLabels                  map[string]string
	ExtraRuntimeAnnotations      map[string]string
	ForceAdoption                bool
	KubeAPIServerName            string
	KubeBurstLimit               int
	KubeCAPath                   string
	KubeConfigBase64             string
	KubeConfigPaths              []string
	KubeContext                  string
	KubeQPSLimit                 int
	KubeSkipTLSVerify            bool
	KubeTLSServerName            string
	KubeToken                    string
	LegacyChartType              helmopts.ChartType
	LegacyExtraValues            map[string]interface{}
	LogRegistryStreamOut         io.Writer
	NetworkParallelism           int
	NoInstallCRDs                bool
	RegistryCredentialsPath      string
	ReleaseStorageDriver         string
	SQLConnectionString          string
	SecretKey                    string
	SecretKeyIgnore              bool
	SecretValuesPaths            []string
	SecretWorkDir                string
	TempDirPath                  string
	Timeout                      time.Duration
	ValuesFileSets               []string
	ValuesFilesPaths             []string
	ValuesSets                   []string
	ValuesStringSets             []string
}

type ReleaseRevisionNotFoundError added in v1.4.0

type ReleaseRevisionNotFoundError struct {
	ReleaseName      string
	ReleaseNamespace string
	Revision         int
}

func (*ReleaseRevisionNotFoundError) Error added in v1.4.0

type ReleaseRollbackOptions

type ReleaseRollbackOptions struct {
	ExtraRuntimeAnnotations    map[string]string
	ForceAdoption              bool
	KubeAPIServerName          string
	KubeBurstLimit             int
	KubeCAPath                 string
	KubeConfigBase64           string
	KubeConfigPaths            []string
	KubeContext                string
	KubeQPSLimit               int
	KubeSkipTLSVerify          bool
	KubeTLSServerName          string
	KubeToken                  string
	NetworkParallelism         int
	NoProgressTablePrint       bool
	ProgressTablePrintInterval time.Duration
	ReleaseHistoryLimit        int
	ReleaseStorageDriver       string
	Revision                   int
	RollbackGraphPath          string
	RollbackReportPath         string
	SQLConnectionString        string
	TempDirPath                string
	Timeout                    time.Duration
	TrackCreationTimeout       time.Duration
	TrackDeletionTimeout       time.Duration
	TrackReadinessTimeout      time.Duration
}

type ReleaseUninstallOptions

type ReleaseUninstallOptions struct {
	DeleteReleaseNamespace     bool
	KubeAPIServerName          string
	KubeBurstLimit             int
	KubeCAPath                 string
	KubeConfigBase64           string
	KubeConfigPaths            []string
	KubeContext                string
	KubeQPSLimit               int
	KubeSkipTLSVerify          bool
	KubeTLSServerName          string
	KubeToken                  string
	NetworkParallelism         int
	NoProgressTablePrint       bool
	ProgressTablePrintInterval time.Duration
	ReleaseHistoryLimit        int
	ReleaseStorageDriver       string
	SQLConnectionString        string
	TempDirPath                string
	Timeout                    time.Duration
	TrackCreationTimeout       time.Duration
	TrackDeletionTimeout       time.Duration
	TrackReadinessTimeout      time.Duration
	UninstallGraphPath         string
	UninstallReportPath        string
}

type SecretFileDecryptOptions

type SecretFileDecryptOptions struct {
	OutputFilePath string
	SecretKey      string
	SecretWorkDir  string
	TempDirPath    string
}

type SecretFileEditOptions

type SecretFileEditOptions struct {
	SecretKey     string
	SecretWorkDir string
	TempDirPath   string
}

type SecretFileEncryptOptions

type SecretFileEncryptOptions struct {
	OutputFilePath string
	SecretKey      string
	SecretWorkDir  string
	TempDirPath    string
}

type SecretKeyCreateOptions

type SecretKeyCreateOptions struct {
	OutputNoPrint bool
	TempDirPath   string
}

type SecretKeyRotateOptions

type SecretKeyRotateOptions struct {
	ChartDirPath      string
	NewSecretKey      string
	OldSecretKey      string
	SecretValuesPaths []string
	SecretWorkDir     string
	TempDirPath       string
}

type SecretValuesFileDecryptOptions

type SecretValuesFileDecryptOptions struct {
	OutputFilePath string
	SecretKey      string
	SecretWorkDir  string
	TempDirPath    string
}

type SecretValuesFileEditOptions

type SecretValuesFileEditOptions struct {
	SecretKey     string
	SecretWorkDir string
	TempDirPath   string
}

type SecretValuesFileEncryptOptions

type SecretValuesFileEncryptOptions struct {
	OutputFilePath string
	SecretKey      string
	SecretWorkDir  string
	TempDirPath    string
}

type SetupLoggingOptions added in v1.3.0

type SetupLoggingOptions struct {
	ColorMode      string
	LogIsParseable bool
}

type VersionOptions

type VersionOptions struct {
	OutputFormat  string
	OutputNoPrint bool
	TempDirPath   string
}

type VersionResult

type VersionResult struct {
	FullVersion  string `json:"full"`
	MajorVersion int    `json:"major"`
	MinorVersion int    `json:"minor"`
	PatchVersion int    `json:"patch"`
}

func Version

func Version(ctx context.Context, opts VersionOptions) (*VersionResult, error)

Jump to

Keyboard shortcuts

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