Documentation
¶
Index ¶
- Constants
- type ClientFactory
- type ClientOption
- type ClientType
- type FallbackClient
- func (c *FallbackClient) DeleteRelease(releaseName string) error
- func (c *FallbackClient) GetReleaseChecksum(releaseName string) (string, error)
- func (c *FallbackClient) GetReleaseLabels(releaseName, labelName string) (string, error)
- func (c *FallbackClient) GetReleaseValues(releaseName string) (utils.Values, error)
- func (c *FallbackClient) IsReleaseExists(releaseName string) (bool, error)
- func (c *FallbackClient) LastReleaseStatus(releaseName string) (string, string, error)
- func (c *FallbackClient) ListReleasesNames() ([]string, error)
- func (c *FallbackClient) Render(releaseName, chart string, valuesPaths, setValues []string, ...) (string, error)
- func (c *FallbackClient) UpgradeRelease(releaseName, chart string, valuesPaths, setValues []string, ...) error
- func (c *FallbackClient) WithExtraLabels(labels map[string]string)
- func (c *FallbackClient) WithLogLabels(logLabels map[string]string)
- type MetricStorage
- type Options
Constants ¶
const ( DefaultHelmBinPath = "helm" DefaultHelmPostRendererPath = "./post-renderer" )
const ( Helm3Lib = ClientType("Helm3Lib") Nelm = ClientType("Nelm") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶ added in v1.1.0
type ClientFactory struct {
NewClientFn func(logger *log.Logger, labels map[string]string) client.HelmClient
ClientType ClientType
// contains filtered or unexported fields
}
func InitHelmClientFactory ¶ added in v1.1.0
func InitHelmClientFactory(helmopts *Options, labels map[string]string) (*ClientFactory, error)
func (*ClientFactory) NewClient ¶ added in v1.1.0
func (f *ClientFactory) NewClient(logger *log.Logger, options ...ClientOption) client.HelmClient
type ClientOption ¶ added in v1.6.2
type ClientOption func(client.HelmClient)
func WithExtraLabels ¶ added in v1.6.2
func WithExtraLabels(labels map[string]string) ClientOption
func WithLogLabels ¶ added in v1.6.2
func WithLogLabels(logLabels map[string]string) ClientOption
type ClientType ¶ added in v1.1.0
type ClientType string
func DetectHelmVersion ¶
func DetectHelmVersion() (ClientType, error)
type FallbackClient ¶ added in v1.21.5
type FallbackClient struct {
// contains filtered or unexported fields
}
FallbackClient wraps a primary HelmClient (nelm) and falls back to a secondary HelmClient (helm3lib) when the primary returns one of the well-known nelm errors that helm3lib is able to recover from: action.ErrBuildPlan and resource.ErrResourceDuplicatesFound.
Read-only methods are always served by the primary client, both clients receive label/annotation updates so the fallback is ready to take over at any moment.
When MetricStorage is configured the client increments metrics.HelmFallbackTotal{module, operation, error_type} on every fallback.
func NewFallbackClient ¶ added in v1.21.5
func NewFallbackClient(primary, fallback client.HelmClient, logger *log.Logger, metricStorage MetricStorage) *FallbackClient
NewFallbackClient builds a FallbackClient. metricStorage is optional; when nil no fallback metric is emitted.
func (*FallbackClient) DeleteRelease ¶ added in v1.21.5
func (c *FallbackClient) DeleteRelease(releaseName string) error
func (*FallbackClient) GetReleaseChecksum ¶ added in v1.21.5
func (c *FallbackClient) GetReleaseChecksum(releaseName string) (string, error)
func (*FallbackClient) GetReleaseLabels ¶ added in v1.21.5
func (c *FallbackClient) GetReleaseLabels(releaseName, labelName string) (string, error)
func (*FallbackClient) GetReleaseValues ¶ added in v1.21.5
func (c *FallbackClient) GetReleaseValues(releaseName string) (utils.Values, error)
func (*FallbackClient) IsReleaseExists ¶ added in v1.21.5
func (c *FallbackClient) IsReleaseExists(releaseName string) (bool, error)
func (*FallbackClient) LastReleaseStatus ¶ added in v1.21.5
func (c *FallbackClient) LastReleaseStatus(releaseName string) (string, string, error)
func (*FallbackClient) ListReleasesNames ¶ added in v1.21.5
func (c *FallbackClient) ListReleasesNames() ([]string, error)
func (*FallbackClient) UpgradeRelease ¶ added in v1.21.5
func (*FallbackClient) WithExtraLabels ¶ added in v1.21.5
func (c *FallbackClient) WithExtraLabels(labels map[string]string)
func (*FallbackClient) WithLogLabels ¶ added in v1.21.5
func (c *FallbackClient) WithLogLabels(logLabels map[string]string)
type MetricStorage ¶ added in v1.21.5
MetricStorage is the minimal counter-emitting surface FallbackClient needs. It is intentionally small so the helm package does not depend on the full metrics-storage interface.