diff --git a/api/go.mod b/api/go.mod index 31f0ccccd..049389949 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,9 +3,10 @@ module github.com/fluxcd/helm-controller/api go 1.14 require ( - github.com/fluxcd/pkg/runtime v0.0.3 - k8s.io/api v0.18.8 - k8s.io/apiextensions-apiserver v0.18.8 - k8s.io/apimachinery v0.18.8 - sigs.k8s.io/controller-runtime v0.6.2 + github.com/fluxcd/pkg/apis/meta v0.0.2 + github.com/fluxcd/pkg/runtime v0.0.6 + k8s.io/api v0.18.9 + k8s.io/apiextensions-apiserver v0.18.9 + k8s.io/apimachinery v0.18.9 + sigs.k8s.io/controller-runtime v0.6.3 ) diff --git a/api/go.sum b/api/go.sum index 794f08754..167e0d88a 100644 --- a/api/go.sum +++ b/api/go.sum @@ -25,7 +25,6 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -58,12 +57,14 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fluxcd/pkg/runtime v0.0.3 h1:x9rOThl1qh5srIUpW0YHEj1I84swMj5m76UqrR1QknY= -github.com/fluxcd/pkg/runtime v0.0.3/go.mod h1:ECBTeplxhgbCJYIjmtwn3ZS0A91/+6YtOS4w2G0LeK4= +github.com/fluxcd/pkg/apis/meta v0.0.2 h1:kyA4Y0IzNjf1joBOnFqpWG7aNDHvtLExZcaHQM7qhRI= +github.com/fluxcd/pkg/apis/meta v0.0.2/go.mod h1:nCNps5JJOcEQr3MNDmZqI4o0chjePSUYL6Q2ktDtotU= +github.com/fluxcd/pkg/runtime v0.0.6 h1:m7qwr2wRePs1vzVlM0Y88vitXSsv1lb3QCJflRpa3qQ= +github.com/fluxcd/pkg/runtime v0.0.6/go.mod h1:iLjncjktQVpqpb1NsY2fW+UYDFOtVyt+yJrxqrrK8A0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -172,7 +173,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -421,22 +421,22 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= -k8s.io/api v0.18.8 h1:aIKUzJPb96f3fKec2lxtY7acZC9gQNDLVhfSGpxBAC4= -k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= +k8s.io/api v0.18.9 h1:7VDtivqwbvLOf8hmXSd/PDSSbpCBq49MELg84EYBYiQ= +k8s.io/api v0.18.9/go.mod h1:9u/h6sUh6FxfErv7QqetX1EB3yBMIYOBXzdcf0Gf0rc= k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= -k8s.io/apiextensions-apiserver v0.18.8 h1:pkqYPKTHa0/3lYwH7201RpF9eFm0lmZDFBNzhN+k/sA= -k8s.io/apiextensions-apiserver v0.18.8/go.mod h1:7f4ySEkkvifIr4+BRrRWriKKIJjPyg9mb/p63dJKnlM= +k8s.io/apiextensions-apiserver v0.18.9 h1:tVEf8rVKh5BnXORnYYCztjbf6CSyGNMt/rAIEyfU00Q= +k8s.io/apiextensions-apiserver v0.18.9/go.mod h1:JagmAhU0TVENzgUZqHJsjCSDh7YuV5o6g01G1Fwh7zI= k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.18.8 h1:jimPrycCqgx2QPearX3to1JePz7wSbVLq+7PdBTTwQ0= -k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= +k8s.io/apimachinery v0.18.9 h1:3ZABKQx3F3xPWlsGhCfUl8W+JXRRblV6Wo2A3zn0pvY= +k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= -k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM= +k8s.io/apiserver v0.18.9/go.mod h1:vXQzMtUCLsGg1Bh+7Jo2mZKHpHZFCZn8eTNSepcIA1M= k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= -k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU= +k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/code-generator v0.18.8/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= +k8s.io/code-generator v0.18.9/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= -k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU= +k8s.io/component-base v0.18.9/go.mod h1:tUo4qZtV8m7t/U+0DgY+fcnn4BFZ480fZdzxOkWH4zk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -449,8 +449,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA= -sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E= +sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE= +sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= diff --git a/api/v2alpha1/condition_types.go b/api/v2alpha1/condition_types.go index 899e04f27..93faa76e5 100644 --- a/api/v2alpha1/condition_types.go +++ b/api/v2alpha1/condition_types.go @@ -16,103 +16,70 @@ limitations under the License. package v2alpha1 -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Condition contains condition information for a HelmRelease. -type Condition struct { - // Type of the condition, one of ('Ready', 'Install', 'Upgrade', 'Test', 'Rollback', 'Uninstall'). - // +required - Type string `json:"type"` - - // Status of the condition, one of ('True', 'False', 'Unknown'). - // +required - Status corev1.ConditionStatus `json:"status"` - - // LastTransitionTime is the timestamp corresponding to the last status - // change of this condition. - // +required - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - - // Reason is a brief machine readable explanation for the condition's last - // transition. - // +required - Reason string `json:"reason,omitempty"` - - // Message is a human readable description of the details of the last - // transition, complementing reason. - // +optional - Message string `json:"message,omitempty"` -} - const ( - // ReadyCondition represents the fact that the HelmRelease has been successfully reconciled. - ReadyCondition string = "Ready" - - // ReleasedCondition represents the fact that the HelmRelease has been successfully released. + // ReleasedCondition represents the fact that the HelmRelease has been + // successfully released. ReleasedCondition string = "Released" - // TestSuccessCondition represents the fact that the tests for the HelmRelease are succeeding. + // TestSuccessCondition represents the fact that the tests for the HelmRelease + // are succeeding. TestSuccessCondition string = "TestSuccess" - // RemediatedCondition represents the fact that the HelmRelease has been successfully remediated. + // RemediatedCondition represents the fact that the HelmRelease has been + // successfully remediated. RemediatedCondition string = "Remediated" ) const ( - // ReconciliationSucceededReason represents the fact that the reconciliation of the HelmRelease has succeeded. - ReconciliationSucceededReason string = "ReconciliationSucceeded" - - // ReconciliationFailedReason represents the fact that the reconciliation of the HelmRelease has failed. - ReconciliationFailedReason string = "ReconciliationFailed" - - // InstallSucceededReason represents the fact that the Helm install for the HelmRelease succeeded. + // InstallSucceededReason represents the fact that the Helm install for the + // HelmRelease succeeded. InstallSucceededReason string = "InstallSucceeded" - // InstallFailedReason represents the fact that the Helm install for the HelmRelease failed. + // InstallFailedReason represents the fact that the Helm install for the + // HelmRelease failed. InstallFailedReason string = "InstallFailed" - // UpgradeSucceededReason represents the fact that the Helm upgrade for the HelmRelease succeeded. + // UpgradeSucceededReason represents the fact that the Helm upgrade for the + // HelmRelease succeeded. UpgradeSucceededReason string = "UpgradeSucceeded" - // UpgradeFailedReason represents the fact that the Helm upgrade for the HelmRelease failed. + // UpgradeFailedReason represents the fact that the Helm upgrade for the + // HelmRelease failed. UpgradeFailedReason string = "UpgradeFailed" - // TestSucceededReason represents the fact that the Helm tests for the HelmRelease succeeded. + // TestSucceededReason represents the fact that the Helm tests for the + // HelmRelease succeeded. TestSucceededReason string = "TestSucceeded" - // TestFailedReason represents the fact that the Helm tests for the HelmRelease failed. + // TestFailedReason represents the fact that the Helm tests for the HelmRelease + // failed. TestFailedReason string = "TestsFailed" - // RollbackSucceededReason represents the fact that the Helm rollback for the HelmRelease succeeded. + // RollbackSucceededReason represents the fact that the Helm rollback for the + // HelmRelease succeeded. RollbackSucceededReason string = "RollbackSucceeded" - // RollbackFailedReason represents the fact that the Helm test for the HelmRelease failed. + // RollbackFailedReason represents the fact that the Helm test for the + // HelmRelease failed. RollbackFailedReason string = "RollbackFailed" - // UninstallSucceededReason represents the fact that the Helm uninstall for the HelmRelease succeeded. + // UninstallSucceededReason represents the fact that the Helm uninstall for the + // HelmRelease succeeded. UninstallSucceededReason string = "UninstallSucceeded" - // UninstallFailedReason represents the fact that the Helm uninstall for the HelmRelease failed. + // UninstallFailedReason represents the fact that the Helm uninstall for the + // HelmRelease failed. UninstallFailedReason string = "UninstallFailed" - // ArtifactFailedReason represents the fact that the artifact download for the HelmRelease failed. + // ArtifactFailedReason represents the fact that the artifact download for the + // HelmRelease failed. ArtifactFailedReason string = "ArtifactFailed" - // InitFailedReason represents the fact that the initialization of the Helm configuration failed. + // InitFailedReason represents the fact that the initialization of the Helm + // configuration failed. InitFailedReason string = "InitFailed" - // GetLastReleaseFailedReason represents the fact that observing the last release failed. + // GetLastReleaseFailedReason represents the fact that observing the last + // release failed. GetLastReleaseFailedReason string = "GetLastReleaseFailed" - - // ProgressingReason represents the fact that the reconciliation for the resource is underway. - ProgressingReason string = "Progressing" - - // DependencyNotReadyReason represents the fact that the one of the dependencies is not ready. - DependencyNotReadyReason string = "DependencyNotReady" - - // SuspendedReason represents the fact that the reconciliation of the HelmRelease is suspended. - SuspendedReason string = "Suspended" ) diff --git a/api/v2alpha1/helmrelease_types.go b/api/v2alpha1/helmrelease_types.go index c21a5325a..21efe5b7c 100644 --- a/api/v2alpha1/helmrelease_types.go +++ b/api/v2alpha1/helmrelease_types.go @@ -26,13 +26,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/runtime/dependency" ) const HelmReleaseKind = "HelmRelease" const HelmReleaseFinalizer = "finalizers.fluxcd.io" -// HelmReleaseSpec defines the desired state of HelmRelease. +// HelmReleaseSpec defines the desired state of a Helm Release. type HelmReleaseSpec struct { // Chart defines the template of the v1alpha1.HelmChart that should be created // for this HelmRelease. @@ -109,7 +110,8 @@ type HelmReleaseSpec struct { Values *apiextensionsv1.JSON `json:"values,omitempty"` } -// GetInstall returns the configuration for Helm install actions for the HelmRelease. +// GetInstall returns the configuration for Helm install actions for the +// HelmRelease. func (in HelmReleaseSpec) GetInstall() Install { if in.Install == nil { return Install{} @@ -117,7 +119,8 @@ func (in HelmReleaseSpec) GetInstall() Install { return *in.Install } -// GetUpgrade returns the configuration for Helm upgrade actions for this HelmRelease. +// GetUpgrade returns the configuration for Helm upgrade actions for this +// HelmRelease. func (in HelmReleaseSpec) GetUpgrade() Upgrade { if in.Upgrade == nil { return Upgrade{} @@ -133,7 +136,8 @@ func (in HelmReleaseSpec) GetTest() Test { return *in.Test } -// GetRollback returns the configuration for Helm rollback actions for this HelmRelease. +// GetRollback returns the configuration for Helm rollback actions for this +// HelmRelease. func (in HelmReleaseSpec) GetRollback() Rollback { if in.Rollback == nil { return Rollback{} @@ -141,7 +145,8 @@ func (in HelmReleaseSpec) GetRollback() Rollback { return *in.Rollback } -// GetUninstall returns the configuration for Helm uninstall actions for this HelmRelease. +// GetUninstall returns the configuration for Helm uninstall actions for this +// HelmRelease. func (in HelmReleaseSpec) GetUninstall() Uninstall { if in.Uninstall == nil { return Uninstall{} @@ -149,23 +154,24 @@ func (in HelmReleaseSpec) GetUninstall() Uninstall { return *in.Uninstall } -// HelmChartTemplate defines the template from which the controller will generate a -// v1alpha1.HelmChart object in the same namespace as the referenced v1alpha1.Source. +// HelmChartTemplate defines the template from which the controller will +// generate a v1alpha1.HelmChart object in the same namespace as the referenced +// v1alpha1.Source. type HelmChartTemplate struct { // Spec holds the template for the v1alpha1.HelmChartSpec for this HelmRelease. // +required Spec HelmChartTemplateSpec `json:"spec"` } -// HelmChartTemplateSpec defines the template from which the controller will generate -// a v1alpha1.HelmChartSpec object. +// HelmChartTemplateSpec defines the template from which the controller will +// generate a v1alpha1.HelmChartSpec object. type HelmChartTemplateSpec struct { // The name or path the Helm chart is available at in the SourceRef. // +required Chart string `json:"chart"` - // Version semver expression, ignored for charts from GitRepository and - // Bucket sources. Defaults to latest when omitted. + // Version semver expression, ignored for charts from v1alpha1.GitRepository and + // v1alpha1.Bucket sources. Defaults to latest when omitted. // +optional Version string `json:"version,omitempty"` @@ -173,13 +179,13 @@ type HelmChartTemplateSpec struct { // +required SourceRef CrossNamespaceObjectReference `json:"sourceRef"` - // Interval at which to check the v1alpha1.Source for updates. - // Defaults to 'HelmReleaseSpec.Interval'. + // Interval at which to check the v1alpha1.Source for updates. Defaults to + // 'HelmReleaseSpec.Interval'. // +optional Interval *metav1.Duration `json:"interval,omitempty"` - // Alternative values file to use as the default chart values, expected to be - // a relative path in the SourceRef. Ignored when omitted. + // Alternative values file to use as the default chart values, expected to be a + // relative path in the SourceRef. Ignored when omitted. // +optional ValuesFile string `json:"valuesFile,omitempty"` } @@ -193,8 +199,8 @@ func (in HelmChartTemplate) GetInterval(defaultInterval metav1.Duration) metav1. return *in.Spec.Interval } -// GetNamespace returns the namespace targeted namespace for the v1alpha1.HelmChart, -// or the given default. +// GetNamespace returns the namespace targeted namespace for the +// v1alpha1.HelmChart, or the given default. func (in HelmChartTemplate) GetNamespace(defaultNamespace string) string { if in.Spec.SourceRef.Namespace == "" { return defaultNamespace @@ -209,7 +215,8 @@ type DeploymentAction interface { GetRemediation() Remediation } -// Remediation defines a consistent interface for InstallRemediation and UpgradeRemediation. +// Remediation defines a consistent interface for InstallRemediation and +// UpgradeRemediation. // +kubebuilder:object:generate=false type Remediation interface { GetRetries() int @@ -221,22 +228,22 @@ type Remediation interface { RetriesExhausted(hr HelmRelease) bool } -// Install holds the configuration for Helm install actions performed for this HelmRelease. +// Install holds the configuration for Helm install actions performed for this +// HelmRelease. type Install struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm install action. Defaults to + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm install action. Defaults to // 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // Remediation holds the remediation configuration for when the - // Helm install action for the HelmRelease fails. The default - // is to not perform any action. + // Remediation holds the remediation configuration for when the Helm install + // action for the HelmRelease fails. The default is to not perform any action. // +optional Remediation *InstallRemediation `json:"remediation,omitempty"` - // DisableWait disables the waiting for resources to be ready after a - // Helm install has been performed. + // DisableWait disables the waiting for resources to be ready after a Helm + // install has been performed. // +optional DisableWait bool `json:"disableWait,omitempty"` @@ -244,13 +251,13 @@ type Install struct { // +optional DisableHooks bool `json:"disableHooks,omitempty"` - // DisableOpenAPIValidation prevents the Helm install action from - // validating rendered templates against the Kubernetes OpenAPI Schema. + // DisableOpenAPIValidation prevents the Helm install action from validating + // rendered templates against the Kubernetes OpenAPI Schema. // +optional DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"` - // Replace tells the Helm install action to re-use the 'ReleaseName', but - // only if that name is a deleted release which remains in the history. + // Replace tells the Helm install action to re-use the 'ReleaseName', but only + // if that name is a deleted release which remains in the history. // +optional Replace bool `json:"replace,omitempty"` @@ -290,24 +297,26 @@ type InstallRemediation struct { // +optional Retries int `json:"retries,omitempty"` - // IgnoreTestFailures tells the controller to skip remediation when - // the Helm tests are run after an install action but fail. - // Defaults to 'Test.IgnoreFailures'. + // IgnoreTestFailures tells the controller to skip remediation when the Helm + // tests are run after an install action but fail. Defaults to + // 'Test.IgnoreFailures'. // +optional IgnoreTestFailures *bool `json:"ignoreTestFailures,omitempty"` - // RemediateLastFailure tells the controller to remediate the last - // failure, when no retries remain. Defaults to 'false'. + // RemediateLastFailure tells the controller to remediate the last failure, when + // no retries remain. Defaults to 'false'. // +optional RemediateLastFailure *bool `json:"remediateLastFailure,omitempty"` } -// GetRetries returns the number of retries that should be attempted on failures. +// GetRetries returns the number of retries that should be attempted on +// failures. func (in InstallRemediation) GetRetries() int { return in.Retries } -// MustIgnoreTestFailures returns the configured IgnoreTestFailures or the given default. +// MustIgnoreTestFailures returns the configured IgnoreTestFailures or the given +// default. func (in InstallRemediation) MustIgnoreTestFailures(def bool) bool { if in.IgnoreTestFailures == nil { return def @@ -315,7 +324,8 @@ func (in InstallRemediation) MustIgnoreTestFailures(def bool) bool { return *in.IgnoreTestFailures } -// MustRemediateLastFailure returns whether to remediate the last failure when no retries remain. +// MustRemediateLastFailure returns whether to remediate the last failure when +// no retries remain. func (in InstallRemediation) MustRemediateLastFailure() bool { if in.RemediateLastFailure == nil { return false @@ -343,22 +353,22 @@ func (in InstallRemediation) RetriesExhausted(hr HelmRelease) bool { return in.Retries >= 0 && in.GetFailureCount(hr) > int64(in.Retries) } -// Upgrade holds the configuration for Helm upgrade actions for this HelmRelease. +// Upgrade holds the configuration for Helm upgrade actions for this +// HelmRelease. type Upgrade struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm upgrade action. Defaults to + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm upgrade action. Defaults to // 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // Remediation holds the remediation configuration for when the - // Helm upgrade action for the HelmRelease fails. The default - // is to not perform any action. + // Remediation holds the remediation configuration for when the Helm upgrade + // action for the HelmRelease fails. The default is to not perform any action. // +optional Remediation *UpgradeRemediation `json:"remediation,omitempty"` - // DisableWait disables the waiting for resources to be ready after a - // Helm upgrade has been performed. + // DisableWait disables the waiting for resources to be ready after a Helm + // upgrade has been performed. // +optional DisableWait bool `json:"disableWait,omitempty"` @@ -366,8 +376,8 @@ type Upgrade struct { // +optional DisableHooks bool `json:"disableHooks,omitempty"` - // DisableOpenAPIValidation prevents the Helm upgrade action from - // validating rendered templates against the Kubernetes OpenAPI Schema. + // DisableOpenAPIValidation prevents the Helm upgrade action from validating + // rendered templates against the Kubernetes OpenAPI Schema. // +optional DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"` @@ -375,8 +385,8 @@ type Upgrade struct { // +optional Force bool `json:"force,omitempty"` - // PreserveValues will make Helm reuse the last release's values and merge - // in overrides from 'Values'. Setting this flag makes the HelmRelease + // PreserveValues will make Helm reuse the last release's values and merge in + // overrides from 'Values'. Setting this flag makes the HelmRelease // non-declarative. // +optional PreserveValues bool `json:"preserveValues,omitempty"` @@ -387,8 +397,8 @@ type Upgrade struct { CleanupOnFail bool `json:"cleanupOnFail,omitempty"` } -// GetTimeout returns the configured timeout for the Helm upgrade action, -// or the given default. +// GetTimeout returns the configured timeout for the Helm upgrade action, or the +// given default. func (in Upgrade) GetTimeout(defaultTimeout metav1.Duration) metav1.Duration { if in.Timeout == nil { return defaultTimeout @@ -401,7 +411,8 @@ func (in Upgrade) GetDescription() string { return "upgrade" } -// GetRemediation returns the configured Remediation for the Helm upgrade action. +// GetRemediation returns the configured Remediation for the Helm upgrade +// action. func (in Upgrade) GetRemediation() Remediation { if in.Remediation == nil { return UpgradeRemediation{} @@ -417,31 +428,31 @@ type UpgradeRemediation struct { // +optional Retries int `json:"retries,omitempty"` - // IgnoreTestFailures tells the controller to skip remediation when - // the Helm tests are run after an upgrade action but fail. + // IgnoreTestFailures tells the controller to skip remediation when the Helm + // tests are run after an upgrade action but fail. // Defaults to 'Test.IgnoreFailures'. // +optional IgnoreTestFailures *bool `json:"ignoreTestFailures,omitempty"` - // RemediateLastFailure tells the controller to remediate the last - // failure, when no retries remain. Defaults to 'false' unless 'Retries' - // is greater than 0. + // RemediateLastFailure tells the controller to remediate the last failure, when + // no retries remain. Defaults to 'false' unless 'Retries' is greater than 0. // +optional RemediateLastFailure *bool `json:"remediateLastFailure,omitempty"` - // Strategy to use for failure remediation. - // Defaults to 'rollback'. + // Strategy to use for failure remediation. Defaults to 'rollback'. // +kubebuilder:validation:Enum=rollback;uninstall // +optional Strategy *RemediationStrategy `json:"strategy,omitempty"` } -// GetRetries returns the number of retries that should be attempted on failures. +// GetRetries returns the number of retries that should be attempted on +// failures. func (in UpgradeRemediation) GetRetries() int { return in.Retries } -// MustIgnoreTestFailures returns the configured IgnoreTestFailures or the given default. +// MustIgnoreTestFailures returns the configured IgnoreTestFailures or the given +// default. func (in UpgradeRemediation) MustIgnoreTestFailures(def bool) bool { if in.IgnoreTestFailures == nil { return def @@ -449,7 +460,8 @@ func (in UpgradeRemediation) MustIgnoreTestFailures(def bool) bool { return *in.IgnoreTestFailures } -// MustRemediateLastFailure returns whether to remediate the last failure when no retries remain. +// MustRemediateLastFailure returns whether to remediate the last failure when +// no retries remain. func (in UpgradeRemediation) MustRemediateLastFailure() bool { if in.RemediateLastFailure == nil { return in.Retries > 0 @@ -480,33 +492,34 @@ func (in UpgradeRemediation) RetriesExhausted(hr HelmRelease) bool { return in.Retries >= 0 && in.GetFailureCount(hr) > int64(in.Retries) } -// RemediationStrategy returns the strategy to use to remediate a failed install or upgrade. +// RemediationStrategy returns the strategy to use to remediate a failed install +// or upgrade. type RemediationStrategy string const ( - // RollbackRemediationStrategy represents a Helm remediation strategy of Helm rollback. + // RollbackRemediationStrategy represents a Helm remediation strategy of Helm + // rollback. RollbackRemediationStrategy RemediationStrategy = "rollback" - // UninstallRemediationStrategy represents a Helm remediation strategy of Helm uninstall. + // UninstallRemediationStrategy represents a Helm remediation strategy of Helm + // uninstall. UninstallRemediationStrategy RemediationStrategy = "uninstall" ) // Test holds the configuration for Helm test actions for this HelmRelease. type Test struct { - // Enable enables Helm test actions for this HelmRelease after an - // Helm install or upgrade action has been performed. + // Enable enables Helm test actions for this HelmRelease after an Helm install + // or upgrade action has been performed. // +optional Enable bool `json:"enable,omitempty"` - // Timeout is the time to wait for any individual Kubernetes operation - // during the performance of a Helm test action. Defaults to - // 'HelmReleaseSpec.Timeout'. + // Timeout is the time to wait for any individual Kubernetes operation during + // the performance of a Helm test action. Defaults to 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // IgnoreFailures tells the controller to skip remediation when - // the Helm tests are run but fail. - // Can be overwritten for tests run after install or upgrade actions - // in 'Install.IgnoreTestFailures' and 'Upgrade.IgnoreTestFailures'. + // IgnoreFailures tells the controller to skip remediation when the Helm tests + // are run but fail. Can be overwritten for tests run after install or upgrade + // actions in 'Install.IgnoreTestFailures' and 'Upgrade.IgnoreTestFailures'. // +optional IgnoreFailures bool `json:"ignoreFailures,omitempty"` } @@ -520,16 +533,17 @@ func (in Test) GetTimeout(defaultTimeout metav1.Duration) metav1.Duration { return *in.Timeout } -// Rollback holds the configuration for Helm rollback actions for this HelmRelease. +// Rollback holds the configuration for Helm rollback actions for this +// HelmRelease. type Rollback struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm rollback action. Defaults to + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm rollback action. Defaults to // 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // DisableWait disables the waiting for resources to be ready after a - // Helm rollback has been performed. + // DisableWait disables the waiting for resources to be ready after a Helm + // rollback has been performed. // +optional DisableWait bool `json:"disableWait,omitempty"` @@ -551,8 +565,8 @@ type Rollback struct { CleanupOnFail bool `json:"cleanupOnFail,omitempty"` } -// GetTimeout returns the configured timeout for the Helm rollback action, -// or the given default. +// GetTimeout returns the configured timeout for the Helm rollback action, or +// the given default. func (in Rollback) GetTimeout(defaultTimeout metav1.Duration) metav1.Duration { if in.Timeout == nil { return defaultTimeout @@ -560,11 +574,12 @@ func (in Rollback) GetTimeout(defaultTimeout metav1.Duration) metav1.Duration { return *in.Timeout } -// Uninstall holds the configuration for Helm uninstall actions for this HelmRelease. +// Uninstall holds the configuration for Helm uninstall actions for this +// HelmRelease. type Uninstall struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm uninstall action. Defaults to - // 'HelmReleaseSpec.Timeout'. + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm uninstall action. Defaults + // to 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` @@ -572,14 +587,14 @@ type Uninstall struct { // +optional DisableHooks bool `json:"disableHooks,omitempty"` - // KeepHistory tells Helm to remove all associated resources and mark the release as - // deleted, but retain the release history. + // KeepHistory tells Helm to remove all associated resources and mark the + // release as deleted, but retain the release history. // +optional KeepHistory bool `json:"keepHistory,omitempty"` } -// GetTimeout returns the configured timeout for the Helm uninstall action, -// or the given default. +// GetTimeout returns the configured timeout for the Helm uninstall action, or +// the given default. func (in Uninstall) GetTimeout(defaultTimeout metav1.Duration) metav1.Duration { if in.Timeout == nil { return defaultTimeout @@ -587,7 +602,7 @@ func (in Uninstall) GetTimeout(defaultTimeout metav1.Duration) metav1.Duration { return *in.Timeout } -// HelmReleaseStatus defines the observed state of HelmRelease +// HelmReleaseStatus defines the observed state of a HelmRelease. type HelmReleaseStatus struct { // ObservedGeneration is the last observed generation. // +optional @@ -600,7 +615,7 @@ type HelmReleaseStatus struct { // Conditions holds the conditions for the HelmRelease. // +optional - Conditions []Condition `json:"conditions,omitempty"` + Conditions []meta.Condition `json:"conditions,omitempty"` // LastAppliedRevision is the revision of the last successfully applied source. // +optional @@ -610,7 +625,8 @@ type HelmReleaseStatus struct { // +optional LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"` - // LastAttemptedValuesChecksum is the SHA1 checksum of the values of the last reconciliation attempt. + // LastAttemptedValuesChecksum is the SHA1 checksum of the values of the last + // reconciliation attempt. // +optional LastAttemptedValuesChecksum string `json:"lastAttemptedValuesChecksum,omitempty"` @@ -623,18 +639,18 @@ type HelmReleaseStatus struct { // +optional HelmChart string `json:"helmChart,omitempty"` - // Failures is the reconciliation failure count against the latest observed state. - // It is reset after a successful reconciliation. + // Failures is the reconciliation failure count against the latest observed + // state. It is reset after a successful reconciliation. // +optional Failures int64 `json:"failures,omitempty"` - // InstallFailures is the install failure count against the latest observed state. - // It is reset after a successful reconciliation. + // InstallFailures is the install failure count against the latest observed + // state. It is reset after a successful reconciliation. // +optional InstallFailures int64 `json:"installFailures,omitempty"` - // UpgradeFailures is the upgrade failure count against the latest observed state. - // It is reset after a successful reconciliation. + // UpgradeFailures is the upgrade failure count against the latest observed + // state. It is reset after a successful reconciliation. // +optional UpgradeFailures int64 `json:"upgradeFailures,omitempty"` } @@ -648,18 +664,19 @@ func (in HelmReleaseStatus) GetHelmChart() (string, string) { return split[0], split[1] } -// HelmReleaseProgressing resets any failures and registers progress toward reconciling the given HelmRelease -// by setting the ReadyCondition to ConditionUnknown for ProgressingReason. +// HelmReleaseProgressing resets any failures and registers progress toward +// reconciling the given HelmRelease by setting the meta.ReadyCondition to +// 'Unknown' for meta.ProgressingReason. func HelmReleaseProgressing(hr HelmRelease) HelmRelease { resetFailureCounts(&hr) - hr.Status.Conditions = []Condition{} - SetHelmReleaseCondition(&hr, ReadyCondition, corev1.ConditionUnknown, ProgressingReason, "reconciliation in progress") + hr.Status.Conditions = []meta.Condition{} + SetHelmReleaseCondition(&hr, meta.ReadyCondition, corev1.ConditionUnknown, meta.ProgressingReason, "reconciliation in progress") return hr } // HelmReleaseNotReady registers a failed reconciliation of the given HelmRelease. func HelmReleaseNotReady(hr HelmRelease, reason, message string) HelmRelease { - SetHelmReleaseCondition(&hr, ReadyCondition, corev1.ConditionFalse, reason, message) + SetHelmReleaseCondition(&hr, meta.ReadyCondition, corev1.ConditionFalse, reason, message) hr.Status.Failures++ return hr } @@ -668,7 +685,7 @@ func HelmReleaseNotReady(hr HelmRelease, reason, message string) HelmRelease { func HelmReleaseReady(hr HelmRelease) HelmRelease { resetFailureCounts(&hr) hr.Status.LastAppliedRevision = hr.Status.LastAttemptedRevision - SetHelmReleaseCondition(&hr, ReadyCondition, corev1.ConditionTrue, ReconciliationSucceededReason, "release reconciliation succeeded") + SetHelmReleaseCondition(&hr, meta.ReadyCondition, corev1.ConditionTrue, meta.ReconciliationSucceededReason, "release reconciliation succeeded") return hr } @@ -691,23 +708,11 @@ func resetFailureCounts(hr *HelmRelease) { hr.Status.UpgradeFailures = 0 } -// GetHelmReleaseCondition return the given condition of the given HelmRelease -// or nil if not present. -func GetHelmReleaseCondition(hr HelmRelease, condition string) *Condition { - for _, c := range hr.Status.Conditions { - if c.Type == condition { - return &c - } - } - - return nil -} - // SetHelmReleaseCondition sets the given condition with the given status, reason and message // on the HelmRelease. func SetHelmReleaseCondition(hr *HelmRelease, condition string, status corev1.ConditionStatus, reason, message string) { - hr.Status.Conditions = filterOutCondition(hr.Status.Conditions, condition) - hr.Status.Conditions = append(hr.Status.Conditions, Condition{ + hr.Status.Conditions = meta.FilterOutCondition(hr.Status.Conditions, condition) + hr.Status.Conditions = append(hr.Status.Conditions, meta.Condition{ Type: condition, Status: status, LastTransitionTime: metav1.Now(), @@ -719,7 +724,7 @@ func SetHelmReleaseCondition(hr *HelmRelease, condition string, status corev1.Co // DeleteHelmReleaseCondition deletes the given condition of the given HelmRelease // if present. func DeleteHelmReleaseCondition(hr *HelmRelease, condition string) { - hr.Status.Conditions = filterOutCondition(hr.Status.Conditions, condition) + hr.Status.Conditions = meta.FilterOutCondition(hr.Status.Conditions, condition) } const ( @@ -746,8 +751,8 @@ type HelmRelease struct { Status HelmReleaseStatus `json:"status,omitempty"` } -// GetValues unmarshals the raw values to a map[string]interface{} -// and returns the result. +// GetValues unmarshals the raw values to a map[string]interface{} and returns +// the result. func (in HelmRelease) GetValues() map[string]interface{} { var values map[string]interface{} if in.Spec.Values != nil { @@ -798,8 +803,8 @@ func (in HelmRelease) GetMaxHistory() int { return *in.Spec.MaxHistory } -// GetDependsOn returns the types.NamespacedName of the HelmRelease, and -// a dependency.CrossNamespaceDependencyReference slice it depends on. +// GetDependsOn returns the types.NamespacedName of the HelmRelease, and a +// dependency.CrossNamespaceDependencyReference slice it depends on. func (in HelmRelease) GetDependsOn() (types.NamespacedName, []dependency.CrossNamespaceDependencyReference) { return types.NamespacedName{ Namespace: in.Namespace, @@ -819,16 +824,3 @@ type HelmReleaseList struct { func init() { SchemeBuilder.Register(&HelmRelease{}, &HelmReleaseList{}) } - -// filterOutCondition returns a new slice of conditions without the -// condition of the given type. -func filterOutCondition(conditions []Condition, condition string) []Condition { - var newConditions []Condition - for _, c := range conditions { - if c.Type == condition { - continue - } - newConditions = append(newConditions, c) - } - return newConditions -} diff --git a/api/v2alpha1/reference_types.go b/api/v2alpha1/reference_types.go index 448f7232c..4365967da 100644 --- a/api/v2alpha1/reference_types.go +++ b/api/v2alpha1/reference_types.go @@ -16,8 +16,8 @@ limitations under the License. package v2alpha1 -// CrossNamespaceObjectReference contains enough information to let you locate the -// typed referenced object at cluster level. +// CrossNamespaceObjectReference contains enough information to let you locate +// the typed referenced object at cluster level. type CrossNamespaceObjectReference struct { // APIVersion of the referent. // +optional @@ -57,19 +57,19 @@ type ValuesReference struct { // +required Name string `json:"name"` - // ValuesKey is the data key where the values.yaml or a specific value can - // be found at. Defaults to 'values.yaml'. + // ValuesKey is the data key where the values.yaml or a specific value can be + // found at. Defaults to 'values.yaml'. // +optional ValuesKey string `json:"valuesKey,omitempty"` - // TargetPath is the YAML dot notation path the value should be merged at. - // When set, the ValuesKey is expected to be a single flat value. - // Defaults to 'None', which results in the values getting merged at the root. + // TargetPath is the YAML dot notation path the value should be merged at. When + // set, the ValuesKey is expected to be a single flat value. Defaults to 'None', + // which results in the values getting merged at the root. // +optional TargetPath string `json:"targetPath,omitempty"` - // Optional marks this ValuesReference as optional. When set, a not found - // error for the values reference is ignored, but any ValuesKey, TargetPath or + // Optional marks this ValuesReference as optional. When set, a not found error + // for the values reference is ignored, but any ValuesKey, TargetPath or // transient error will still result in a reconciliation failure. // +optional Optional bool `json:"optional,omitempty"` diff --git a/api/v2alpha1/zz_generated.deepcopy.go b/api/v2alpha1/zz_generated.deepcopy.go index 8110fed51..c670d5725 100644 --- a/api/v2alpha1/zz_generated.deepcopy.go +++ b/api/v2alpha1/zz_generated.deepcopy.go @@ -21,28 +21,13 @@ limitations under the License. package v2alpha1 import ( + "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/runtime/dependency" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Condition) DeepCopyInto(out *Condition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. -func (in *Condition) DeepCopy() *Condition { - if in == nil { - return nil - } - out := new(Condition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CrossNamespaceObjectReference) DeepCopyInto(out *CrossNamespaceObjectReference) { *out = *in @@ -226,7 +211,7 @@ func (in *HelmReleaseStatus) DeepCopyInto(out *HelmReleaseStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]Condition, len(*in)) + *out = make([]meta.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml b/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml index 923123498..a640629a8 100644 --- a/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml +++ b/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml @@ -46,7 +46,7 @@ spec: metadata: type: object spec: - description: HelmReleaseSpec defines the desired state of HelmRelease. + description: HelmReleaseSpec defines the desired state of a Helm Release. properties: chart: description: Chart defines the template of the v1alpha1.HelmChart @@ -98,8 +98,8 @@ spec: type: string version: description: Version semver expression, ignored for charts - from GitRepository and Bucket sources. Defaults to latest - when omitted. + from v1alpha1.GitRepository and v1alpha1.Bucket sources. + Defaults to latest when omitted. type: string required: - chart @@ -394,12 +394,13 @@ spec: - interval type: object status: - description: HelmReleaseStatus defines the observed state of HelmRelease + description: HelmReleaseStatus defines the observed state of a HelmRelease. properties: conditions: description: Conditions holds the conditions for the HelmRelease. items: - description: Condition contains condition information for a HelmRelease. + description: Condition contains condition information of a toolkit + resource. properties: lastTransitionTime: description: LastTransitionTime is the timestamp corresponding @@ -419,8 +420,7 @@ spec: 'Unknown'). type: string type: - description: Type of the condition, one of ('Ready', 'Install', - 'Upgrade', 'Test', 'Rollback', 'Uninstall'). + description: Type of the condition. type: string required: - status diff --git a/controllers/helmchart_watcher.go b/controllers/helmchart_watcher.go index 6b9206fbc..f75619721 100644 --- a/controllers/helmchart_watcher.go +++ b/controllers/helmchart_watcher.go @@ -30,7 +30,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - consts "github.com/fluxcd/pkg/runtime" + "github.com/fluxcd/pkg/apis/meta" sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" v2 "github.com/fluxcd/helm-controller/api/v2alpha1" @@ -115,7 +115,7 @@ func (r *HelmChartWatcher) requestReconciliation(ctx context.Context, hr v2.Helm if hr.Annotations == nil { hr.Annotations = make(map[string]string) } - hr.Annotations[consts.ReconcileAtAnnotation] = metav1.Now().String() + hr.Annotations[meta.ReconcileAtAnnotation] = metav1.Now().String() err = r.Update(ctx, &hr) return }) diff --git a/controllers/helmrelease_controller.go b/controllers/helmrelease_controller.go index 5736bdcb9..ac0cc2f6a 100644 --- a/controllers/helmrelease_controller.go +++ b/controllers/helmrelease_controller.go @@ -44,8 +44,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/recorder" - consts "github.com/fluxcd/pkg/runtime" "github.com/fluxcd/pkg/runtime/predicates" sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" @@ -143,7 +143,7 @@ func (r *HelmReleaseReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) func (r *HelmReleaseReconciler) reconcile(ctx context.Context, log logr.Logger, hr v2.HelmRelease) (v2.HelmRelease, ctrl.Result, error) { // Record the value of the reconciliation request, if any - if v, ok := hr.GetAnnotations()[consts.ReconcileAtAnnotation]; ok { + if v, ok := hr.GetAnnotations()[meta.ReconcileAtAnnotation]; ok { hr.Status.LastHandledReconcileAt = v } @@ -160,7 +160,7 @@ func (r *HelmReleaseReconciler) reconcile(ctx context.Context, log logr.Logger, if hr.Spec.Suspend { msg := "HelmRelease is suspended, skipping reconciliation" log.Info(msg) - return v2.HelmReleaseNotReady(hr, v2.SuspendedReason, msg), ctrl.Result{}, nil + return v2.HelmReleaseNotReady(hr, meta.SuspendedReason, msg), ctrl.Result{}, nil } // Reconcile chart based on the HelmChartTemplate @@ -196,7 +196,7 @@ func (r *HelmReleaseReconciler) reconcile(ctx context.Context, log logr.Logger, // Exponential backoff would cause execution to be prolonged too much, // instead we requeue on a fixed interval. return v2.HelmReleaseNotReady(hr, - v2.DependencyNotReadyReason, err.Error()), ctrl.Result{RequeueAfter: r.requeueDependency}, nil + meta.DependencyNotReadyReason, err.Error()), ctrl.Result{RequeueAfter: r.requeueDependency}, nil } log.Info("all dependencies are ready, proceeding with release") } @@ -306,7 +306,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, log logr.L } // Check status of any previous release attempt. - released := v2.GetHelmReleaseCondition(hr, v2.ReleasedCondition) + released := meta.GetCondition(hr.Status.Conditions, v2.ReleasedCondition) if released != nil { switch released.Status { // Succeed if the previous release attempt succeeded. @@ -314,7 +314,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, log logr.L return v2.HelmReleaseReady(hr), nil case corev1.ConditionFalse: // Fail if the previous release attempt remediation failed. - remediated := v2.GetHelmReleaseCondition(hr, v2.RemediatedCondition) + remediated := meta.GetCondition(hr.Status.Conditions, v2.RemediatedCondition) if remediated != nil && remediated.Status == corev1.ConditionFalse { err = fmt.Errorf("previous release attempt remediation failed") return v2.HelmReleaseNotReady(hr, remediated.Reason, remediated.Message), err @@ -360,7 +360,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, log logr.L // Propagate any test error if not marked ignored. if testErr != nil && !remediation.MustIgnoreTestFailures(hr.Spec.GetTest().IgnoreFailures) { - testsPassing := v2.GetHelmReleaseCondition(hr, v2.TestSuccessCondition) + testsPassing := meta.GetCondition(hr.Status.Conditions, v2.TestSuccessCondition) v2.SetHelmReleaseCondition(&hr, v2.ReleasedCondition, corev1.ConditionFalse, testsPassing.Reason, testsPassing.Message) err = testErr } @@ -405,7 +405,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, log logr.L hr.Status.LastReleaseRevision = util.ReleaseRevision(rel) if err != nil { - reason := v2.ReconciliationFailedReason + reason := meta.ReconciliationFailedReason var cerr *ConditionError if errors.As(err, &cerr) { reason = cerr.Reason @@ -431,10 +431,8 @@ func (r *HelmReleaseReconciler) checkDependencies(hr v2.HelmRelease) error { return fmt.Errorf("dependency '%s' is not ready", dName) } - for _, condition := range dHr.Status.Conditions { - if condition.Type == consts.ReadyCondition && condition.Status != corev1.ConditionTrue { - return fmt.Errorf("dependency '%s' is not ready", dName) - } + if c := meta.GetCondition(dHr.Status.Conditions, meta.ReadyCondition); c == nil || c.Status != corev1.ConditionTrue { + return fmt.Errorf("dependency '%s' is not ready", dName) } } return nil diff --git a/docs/api/helmrelease.md b/docs/api/helmrelease.md index 4406851fa..42a264521 100644 --- a/docs/api/helmrelease.md +++ b/docs/api/helmrelease.md @@ -295,98 +295,14 @@ HelmReleaseStatus -

Condition -

-

-(Appears on: -HelmReleaseStatus) -

-

Condition contains condition information for a HelmRelease.

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-type
- -string - -
-

Type of the condition, one of (‘Ready’, ‘Install’, ‘Upgrade’, ‘Test’, ‘Rollback’, ‘Uninstall’).

-
-status
- - -Kubernetes core/v1.ConditionStatus - - -
-

Status of the condition, one of (‘True’, ‘False’, ‘Unknown’).

-
-lastTransitionTime
- - -Kubernetes meta/v1.Time - - -
-

LastTransitionTime is the timestamp corresponding to the last status -change of this condition.

-
-reason
- -string - -
-

Reason is a brief machine readable explanation for the condition’s last -transition.

-
-message
- -string - -
-(Optional) -

Message is a human readable description of the details of the last -transition, complementing reason.

-
-
-

CrossNamespaceObjectReference

(Appears on: HelmChartTemplateSpec)

-

CrossNamespaceObjectReference contains enough information to let you locate the -typed referenced object at cluster level.

+

CrossNamespaceObjectReference contains enough information to let you locate +the typed referenced object at cluster level.

@@ -456,8 +372,9 @@ string (Appears on:HelmReleaseSpec)

-

HelmChartTemplate defines the template from which the controller will generate a -v1alpha1.HelmChart object in the same namespace as the referenced v1alpha1.Source.

+

HelmChartTemplate defines the template from which the controller will +generate a v1alpha1.HelmChart object in the same namespace as the referenced +v1alpha1.Source.

@@ -502,8 +419,8 @@ string @@ -530,8 +447,8 @@ Kubernetes meta/v1.Duration @@ -543,8 +460,8 @@ string
(Optional) -

Version semver expression, ignored for charts from GitRepository and -Bucket sources. Defaults to latest when omitted.

+

Version semver expression, ignored for charts from v1alpha1.GitRepository and +v1alpha1.Bucket sources. Defaults to latest when omitted.

(Optional) -

Interval at which to check the v1alpha1.Source for updates. -Defaults to ‘HelmReleaseSpec.Interval’.

+

Interval at which to check the v1alpha1.Source for updates. Defaults to +‘HelmReleaseSpec.Interval’.

(Optional) -

Alternative values file to use as the default chart values, expected to be -a relative path in the SourceRef. Ignored when omitted.

+

Alternative values file to use as the default chart values, expected to be a +relative path in the SourceRef. Ignored when omitted.

@@ -560,8 +477,8 @@ a relative path in the SourceRef. Ignored when omitted.

(Appears on: HelmChartTemplate)

-

HelmChartTemplateSpec defines the template from which the controller will generate -a v1alpha1.HelmChartSpec object.

+

HelmChartTemplateSpec defines the template from which the controller will +generate a v1alpha1.HelmChartSpec object.

@@ -592,8 +509,8 @@ string @@ -620,8 +537,8 @@ Kubernetes meta/v1.Duration @@ -633,8 +550,8 @@ string @@ -647,7 +564,7 @@ a relative path in the SourceRef. Ignored when omitted.

(Appears on:HelmRelease)

-

HelmReleaseSpec defines the desired state of HelmRelease.

+

HelmReleaseSpec defines the desired state of a Helm Release.

(Optional) -

Version semver expression, ignored for charts from GitRepository and -Bucket sources. Defaults to latest when omitted.

+

Version semver expression, ignored for charts from v1alpha1.GitRepository and +v1alpha1.Bucket sources. Defaults to latest when omitted.

(Optional) -

Interval at which to check the v1alpha1.Source for updates. -Defaults to ‘HelmReleaseSpec.Interval’.

+

Interval at which to check the v1alpha1.Source for updates. Defaults to +‘HelmReleaseSpec.Interval’.

(Optional) -

Alternative values file to use as the default chart values, expected to be -a relative path in the SourceRef. Ignored when omitted.

+

Alternative values file to use as the default chart values, expected to be a +relative path in the SourceRef. Ignored when omitted.

@@ -876,7 +793,7 @@ Kubernetes pkg/apis/apiextensions/v1.JSON (Appears on:HelmRelease)

-

HelmReleaseStatus defines the observed state of HelmRelease

+

HelmReleaseStatus defines the observed state of a HelmRelease.

@@ -916,8 +833,8 @@ annotating the HelmRelease) handled by the reconciler.

@@ -959,7 +876,8 @@ string @@ -996,8 +914,8 @@ int64 @@ -1009,8 +927,8 @@ int64 @@ -1022,8 +940,8 @@ int64 @@ -1036,7 +954,8 @@ It is reset after a successful reconciliation.

(Appears on:HelmReleaseSpec)

-

Install holds the configuration for Helm install actions performed for this HelmRelease.

+

Install holds the configuration for Helm install actions performed for this +HelmRelease.

conditions
- -[]Condition + +[]github.com/fluxcd/pkg/apis/meta.Condition
(Optional) -

LastAttemptedValuesChecksum is the SHA1 checksum of the values of the last reconciliation attempt.

+

LastAttemptedValuesChecksum is the SHA1 checksum of the values of the last +reconciliation attempt.

(Optional) -

Failures is the reconciliation failure count against the latest observed state. -It is reset after a successful reconciliation.

+

Failures is the reconciliation failure count against the latest observed +state. It is reset after a successful reconciliation.

(Optional) -

InstallFailures is the install failure count against the latest observed state. -It is reset after a successful reconciliation.

+

InstallFailures is the install failure count against the latest observed +state. It is reset after a successful reconciliation.

(Optional) -

UpgradeFailures is the upgrade failure count against the latest observed state. -It is reset after a successful reconciliation.

+

UpgradeFailures is the upgrade failure count against the latest observed +state. It is reset after a successful reconciliation.

@@ -1058,8 +977,8 @@ Kubernetes meta/v1.Duration @@ -1074,9 +993,8 @@ InstallRemediation @@ -1088,8 +1006,8 @@ bool @@ -1113,8 +1031,8 @@ bool @@ -1126,8 +1044,8 @@ bool @@ -1187,9 +1105,9 @@ bool @@ -1201,8 +1119,8 @@ bool @@ -1211,21 +1129,24 @@ failure, when no retries remain. Defaults to ‘false’.

Remediation

-

Remediation defines a consistent interface for InstallRemediation and UpgradeRemediation.

+

Remediation defines a consistent interface for InstallRemediation and +UpgradeRemediation.

RemediationStrategy (string alias)

(Appears on: UpgradeRemediation)

-

RemediationStrategy returns the strategy to use to remediate a failed install or upgrade.

+

RemediationStrategy returns the strategy to use to remediate a failed install +or upgrade.

Rollback

(Appears on: HelmReleaseSpec)

-

Rollback holds the configuration for Helm rollback actions for this HelmRelease.

+

Rollback holds the configuration for Helm rollback actions for this +HelmRelease.

(Optional) -

Timeout is the time to wait for any individual Kubernetes operation (like Jobs -for hooks) during the performance of a Helm install action. Defaults to +

Timeout is the time to wait for any individual Kubernetes operation (like +Jobs for hooks) during the performance of a Helm install action. Defaults to ‘HelmReleaseSpec.Timeout’.

(Optional) -

Remediation holds the remediation configuration for when the -Helm install action for the HelmRelease fails. The default -is to not perform any action.

+

Remediation holds the remediation configuration for when the Helm install +action for the HelmRelease fails. The default is to not perform any action.

(Optional) -

DisableWait disables the waiting for resources to be ready after a -Helm install has been performed.

+

DisableWait disables the waiting for resources to be ready after a Helm +install has been performed.

(Optional) -

DisableOpenAPIValidation prevents the Helm install action from -validating rendered templates against the Kubernetes OpenAPI Schema.

+

DisableOpenAPIValidation prevents the Helm install action from validating +rendered templates against the Kubernetes OpenAPI Schema.

(Optional) -

Replace tells the Helm install action to re-use the ‘ReleaseName’, but -only if that name is a deleted release which remains in the history.

+

Replace tells the Helm install action to re-use the ‘ReleaseName’, but only +if that name is a deleted release which remains in the history.

(Optional) -

IgnoreTestFailures tells the controller to skip remediation when -the Helm tests are run after an install action but fail. -Defaults to ‘Test.IgnoreFailures’.

+

IgnoreTestFailures tells the controller to skip remediation when the Helm +tests are run after an install action but fail. Defaults to +‘Test.IgnoreFailures’.

(Optional) -

RemediateLastFailure tells the controller to remediate the last -failure, when no retries remain. Defaults to ‘false’.

+

RemediateLastFailure tells the controller to remediate the last failure, when +no retries remain. Defaults to ‘false’.

@@ -1247,8 +1168,8 @@ Kubernetes meta/v1.Duration @@ -1261,8 +1182,8 @@ bool @@ -1344,8 +1265,8 @@ bool @@ -1359,9 +1280,8 @@ Kubernetes meta/v1.Duration @@ -1373,10 +1293,9 @@ bool @@ -1389,7 +1308,8 @@ in ‘Install.IgnoreTestFailures’ and ‘Upgrade.IgnoreTestFailure (Appears on:HelmReleaseSpec)

-

Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.

+

Uninstall holds the configuration for Helm uninstall actions for this +HelmRelease.

(Optional) -

Timeout is the time to wait for any individual Kubernetes operation (like Jobs -for hooks) during the performance of a Helm rollback action. Defaults to +

Timeout is the time to wait for any individual Kubernetes operation (like +Jobs for hooks) during the performance of a Helm rollback action. Defaults to ‘HelmReleaseSpec.Timeout’.

(Optional) -

DisableWait disables the waiting for resources to be ready after a -Helm rollback has been performed.

+

DisableWait disables the waiting for resources to be ready after a Helm +rollback has been performed.

(Optional) -

Enable enables Helm test actions for this HelmRelease after an -Helm install or upgrade action has been performed.

+

Enable enables Helm test actions for this HelmRelease after an Helm install +or upgrade action has been performed.

(Optional) -

Timeout is the time to wait for any individual Kubernetes operation -during the performance of a Helm test action. Defaults to -‘HelmReleaseSpec.Timeout’.

+

Timeout is the time to wait for any individual Kubernetes operation during +the performance of a Helm test action. Defaults to ‘HelmReleaseSpec.Timeout’.

(Optional) -

IgnoreFailures tells the controller to skip remediation when -the Helm tests are run but fail. -Can be overwritten for tests run after install or upgrade actions -in ‘Install.IgnoreTestFailures’ and ‘Upgrade.IgnoreTestFailures’.

+

IgnoreFailures tells the controller to skip remediation when the Helm tests +are run but fail. Can be overwritten for tests run after install or upgrade +actions in ‘Install.IgnoreTestFailures’ and ‘Upgrade.IgnoreTestFailures’.

@@ -1411,9 +1331,9 @@ Kubernetes meta/v1.Duration @@ -1437,8 +1357,8 @@ bool @@ -1451,7 +1371,8 @@ deleted, but retain the release history.

(Appears on:HelmReleaseSpec)

-

Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.

+

Upgrade holds the configuration for Helm upgrade actions for this +HelmRelease.

(Optional) -

Timeout is the time to wait for any individual Kubernetes operation (like Jobs -for hooks) during the performance of a Helm uninstall action. Defaults to -‘HelmReleaseSpec.Timeout’.

+

Timeout is the time to wait for any individual Kubernetes operation (like +Jobs for hooks) during the performance of a Helm uninstall action. Defaults +to ‘HelmReleaseSpec.Timeout’.

(Optional) -

KeepHistory tells Helm to remove all associated resources and mark the release as -deleted, but retain the release history.

+

KeepHistory tells Helm to remove all associated resources and mark the +release as deleted, but retain the release history.

@@ -1473,8 +1394,8 @@ Kubernetes meta/v1.Duration @@ -1489,9 +1410,8 @@ UpgradeRemediation @@ -1503,8 +1423,8 @@ bool @@ -1528,8 +1448,8 @@ bool @@ -1553,8 +1473,8 @@ bool @@ -1615,8 +1535,8 @@ bool @@ -1629,9 +1549,8 @@ bool @@ -1645,8 +1564,7 @@ RemediationStrategy @@ -1703,8 +1621,8 @@ string @@ -1716,9 +1634,9 @@ string @@ -1730,8 +1648,8 @@ bool diff --git a/docs/spec/v2alpha1/helmreleases.md b/docs/spec/v2alpha1/helmreleases.md index 71eea9267..ed5e3bb4d 100644 --- a/docs/spec/v2alpha1/helmreleases.md +++ b/docs/spec/v2alpha1/helmreleases.md @@ -10,7 +10,7 @@ reconciliation should happen at, and a set of options to control the settings of automated Helm actions that are being performed. ```go -// HelmReleaseSpec defines the desired state of HelmRelease. +// HelmReleaseSpec defines the desired state of a Helm Release. type HelmReleaseSpec struct { // Chart defines the template of the v1alpha1.HelmChart that should be created // for this HelmRelease. @@ -42,10 +42,11 @@ type HelmReleaseSpec struct { // +optional TargetNamespace string `json:"targetNamespace,omitempty"` - // DependsOn may contain a list of HelmReleases that must be ready before this - // HelmRelease can be reconciled. + // DependsOn may contain a dependency.CrossNamespaceDependencyReference slice with + // references to HelmRelease resources that must be ready before this HelmRelease + // can be reconciled. // +optional - DependsOn []string `json:"dependsOn,omitempty"` + DependsOn []dependency.CrossNamespaceDependencyReference `json:"dependsOn,omitempty"` // Timeout is the time to wait for any individual Kubernetes operation (like Jobs // for hooks) during the performance of a Helm action. Defaults to '5m0s'. @@ -86,23 +87,24 @@ type HelmReleaseSpec struct { Values *apiextensionsv1.JSON `json:"values,omitempty"` } -// HelmChartTemplate defines the template from which the controller will generate a -// v1alpha1.HelmChart object in the same namespace as the referenced v1alpha1.Source. +// HelmChartTemplate defines the template from which the controller will +// generate a v1alpha1.HelmChart object in the same namespace as the referenced +// v1alpha1.Source. type HelmChartTemplate struct { // Spec holds the template for the v1alpha1.HelmChartSpec for this HelmRelease. // +required Spec HelmChartTemplateSpec `json:"spec"` } -// HelmChartTemplateSpec defines the template from which the controller will generate -// a v1alpha1.HelmChartSpec object. +// HelmChartTemplateSpec defines the template from which the controller will +// generate a v1alpha1.HelmChartSpec object. type HelmChartTemplateSpec struct { // The name or path the Helm chart is available at in the SourceRef. // +required Chart string `json:"chart"` - // Version semver expression, ignored for charts from GitRepository and - // Bucket sources. Defaults to latest when omitted. + // Version semver expression, ignored for charts from v1alpha1.GitRepository and + // v1alpha1.Bucket sources. Defaults to latest when omitted. // +optional Version string `json:"version,omitempty"` @@ -110,28 +112,33 @@ type HelmChartTemplateSpec struct { // +required SourceRef CrossNamespaceObjectReference `json:"sourceRef"` - // Interval at which to check the v1alpha1.Source for updates. - // Defaults to 'HelmReleaseSpec.Interval'. + // Interval at which to check the v1alpha1.Source for updates. Defaults to + // 'HelmReleaseSpec.Interval'. // +optional Interval *metav1.Duration `json:"interval,omitempty"` + + // Alternative values file to use as the default chart values, expected to be a + // relative path in the SourceRef. Ignored when omitted. + // +optional + ValuesFile string `json:"valuesFile,omitempty"` } -// Install holds the configuration for Helm install actions performed for this HelmRelease. +// Install holds the configuration for Helm install actions performed for this +// HelmRelease. type Install struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm install action. Defaults to + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm install action. Defaults to // 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // Remediation holds the remediation configuration for when the - // Helm install action for the HelmRelease fails. The default - // is to not perform any action. + // Remediation holds the remediation configuration for when the Helm install + // action for the HelmRelease fails. The default is to not perform any action. // +optional Remediation *InstallRemediation `json:"remediation,omitempty"` - // DisableWait disables the waiting for resources to be ready after a - // Helm install has been performed. + // DisableWait disables the waiting for resources to be ready after a Helm + // install has been performed. // +optional DisableWait bool `json:"disableWait,omitempty"` @@ -139,13 +146,13 @@ type Install struct { // +optional DisableHooks bool `json:"disableHooks,omitempty"` - // DisableOpenAPIValidation prevents the Helm install action from - // validating rendered templates against the Kubernetes OpenAPI Schema. + // DisableOpenAPIValidation prevents the Helm install action from validating + // rendered templates against the Kubernetes OpenAPI Schema. // +optional DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"` - // Replace tells the Helm install action to re-use the 'ReleaseName', but - // only if that name is a deleted release which remains in the history. + // Replace tells the Helm install action to re-use the 'ReleaseName', but only + // if that name is a deleted release which remains in the history. // +optional Replace bool `json:"replace,omitempty"` @@ -163,34 +170,34 @@ type InstallRemediation struct { // +optional Retries int `json:"retries,omitempty"` - // IgnoreTestFailures tells the controller to skip remediation when - // the Helm tests are run after an install action but fail. - // Defaults to 'Test.IgnoreFailures'. + // IgnoreTestFailures tells the controller to skip remediation when the Helm + // tests are run after an install action but fail. Defaults to + // 'Test.IgnoreFailures'. // +optional IgnoreTestFailures *bool `json:"ignoreTestFailures,omitempty"` - // RemediateLastFailure tells the controller to remediate the last - // failure, when no retries remain. Defaults to 'false'. + // RemediateLastFailure tells the controller to remediate the last failure, when + // no retries remain. Defaults to 'false'. // +optional RemediateLastFailure *bool `json:"remediateLastFailure,omitempty"` } -// Upgrade holds the configuration for Helm upgrade actions for this HelmRelease. +// Upgrade holds the configuration for Helm upgrade actions for this +// HelmRelease. type Upgrade struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm upgrade action. Defaults to + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm upgrade action. Defaults to // 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // Remediation holds the remediation configuration for when the - // Helm upgrade action for the HelmRelease fails. The default - // is to not perform any action. + // Remediation holds the remediation configuration for when the Helm upgrade + // action for the HelmRelease fails. The default is to not perform any action. // +optional Remediation *UpgradeRemediation `json:"remediation,omitempty"` - // DisableWait disables the waiting for resources to be ready after a - // Helm upgrade has been performed. + // DisableWait disables the waiting for resources to be ready after a Helm + // upgrade has been performed. // +optional DisableWait bool `json:"disableWait,omitempty"` @@ -198,8 +205,8 @@ type Upgrade struct { // +optional DisableHooks bool `json:"disableHooks,omitempty"` - // DisableOpenAPIValidation prevents the Helm upgrade action from - // validating rendered templates against the Kubernetes OpenAPI Schema. + // DisableOpenAPIValidation prevents the Helm upgrade action from validating + // rendered templates against the Kubernetes OpenAPI Schema. // +optional DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"` @@ -207,8 +214,8 @@ type Upgrade struct { // +optional Force bool `json:"force,omitempty"` - // PreserveValues will make Helm reuse the last release's values and merge - // in overrides from 'Values'. Setting this flag makes the HelmRelease + // PreserveValues will make Helm reuse the last release's values and merge in + // overrides from 'Values'. Setting this flag makes the HelmRelease // non-declarative. // +optional PreserveValues bool `json:"preserveValues,omitempty"` @@ -227,20 +234,18 @@ type UpgradeRemediation struct { // +optional Retries int `json:"retries,omitempty"` - // IgnoreTestFailures tells the controller to skip remediation when - // the Helm tests are run after an upgrade action but fail. + // IgnoreTestFailures tells the controller to skip remediation when the Helm + // tests are run after an upgrade action but fail. // Defaults to 'Test.IgnoreFailures'. // +optional IgnoreTestFailures *bool `json:"ignoreTestFailures,omitempty"` - // RemediateLastFailure tells the controller to remediate the last - // failure, when no retries remain. Defaults to 'false' unless 'Retries' - // is greater than 0. + // RemediateLastFailure tells the controller to remediate the last failure, when + // no retries remain. Defaults to 'false' unless 'Retries' is greater than 0. // +optional RemediateLastFailure *bool `json:"remediateLastFailure,omitempty"` - // Strategy to use for failure remediation. - // Defaults to 'rollback'. + // Strategy to use for failure remediation. Defaults to 'rollback'. // +kubebuilder:validation:Enum=rollback;uninstall // +optional Strategy *RemediationStrategy `json:"strategy,omitempty"` @@ -248,35 +253,34 @@ type UpgradeRemediation struct { // Test holds the configuration for Helm test actions for this HelmRelease. type Test struct { - // Enable enables Helm test actions for this HelmRelease after an - // Helm install or upgrade action has been performed. + // Enable enables Helm test actions for this HelmRelease after an Helm install + // or upgrade action has been performed. // +optional Enable bool `json:"enable,omitempty"` - // Timeout is the time to wait for any individual Kubernetes operation - // during the performance of a Helm test action. Defaults to - // 'HelmReleaseSpec.Timeout'. + // Timeout is the time to wait for any individual Kubernetes operation during + // the performance of a Helm test action. Defaults to 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // IgnoreFailures tells the controller to skip remediation when - // the Helm tests are run but fail. - // Can be overwritten for tests run after install or upgrade actions - // in 'Install.IgnoreTestFailures' and 'Upgrade.IgnoreTestFailures'. + // IgnoreFailures tells the controller to skip remediation when the Helm tests + // are run but fail. Can be overwritten for tests run after install or upgrade + // actions in 'Install.IgnoreTestFailures' and 'Upgrade.IgnoreTestFailures'. // +optional IgnoreFailures bool `json:"ignoreFailures,omitempty"` } -// Rollback holds the configuration for Helm rollback actions for this HelmRelease. +// Rollback holds the configuration for Helm rollback actions for this +// HelmRelease. type Rollback struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm rollback action. Defaults to + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm rollback action. Defaults to // 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // DisableWait disables the waiting for resources to be ready after a - // Helm rollback has been performed. + // DisableWait disables the waiting for resources to be ready after a Helm + // rollback has been performed. // +optional DisableWait bool `json:"disableWait,omitempty"` @@ -298,11 +302,12 @@ type Rollback struct { CleanupOnFail bool `json:"cleanupOnFail,omitempty"` } -// Uninstall holds the configuration for Helm uninstall actions for this HelmRelease. +// Uninstall holds the configuration for Helm uninstall actions for this +// HelmRelease. type Uninstall struct { - // Timeout is the time to wait for any individual Kubernetes operation (like Jobs - // for hooks) during the performance of a Helm uninstall action. Defaults to - // 'HelmReleaseSpec.Timeout'. + // Timeout is the time to wait for any individual Kubernetes operation (like + // Jobs for hooks) during the performance of a Helm uninstall action. Defaults + // to 'HelmReleaseSpec.Timeout'. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` @@ -310,14 +315,14 @@ type Uninstall struct { // +optional DisableHooks bool `json:"disableHooks,omitempty"` - // KeepHistory tells Helm to remove all associated resources and mark the release as - // deleted, but retain the release history. + // KeepHistory tells Helm to remove all associated resources and mark the + // release as deleted, but retain the release history. // +optional KeepHistory bool `json:"keepHistory,omitempty"` } ``` -Reference types: +### Reference types ```go // CrossNamespaceObjectReference contains enough information to let you locate the @@ -361,94 +366,155 @@ type ValuesReference struct { // +required Name string `json:"name"` - // ValuesKey is the data key where the values.yaml or a specific value can - // be found at. Defaults to 'values.yaml'. + // ValuesKey is the data key where the values.yaml or a specific value can be + // found at. Defaults to 'values.yaml'. // +optional ValuesKey string `json:"valuesKey,omitempty"` - // TargetPath is the YAML dot notation path the value should be merged at. - // When set, the ValuesKey is expected to be a single flat value. - // Defaults to 'None', which results in the values getting merged at the root. + // TargetPath is the YAML dot notation path the value should be merged at. When + // set, the ValuesKey is expected to be a single flat value. Defaults to 'None', + // which results in the values getting merged at the root. // +optional TargetPath string `json:"targetPath,omitempty"` + + // Optional marks this ValuesReference as optional. When set, a not found error + // for the values reference is ignored, but any ValuesKey, TargetPath or + // transient error will still result in a reconciliation failure. + // +optional + Optional bool `json:"optional,omitempty"` } ``` -Status condition types: +### Status ```go -const ( - // ReadyCondition represents the fact that the HelmRelease has been successfully reconciled. - ReadyCondition string = "Ready" +// HelmReleaseStatus defines the observed state of a HelmRelease. +type HelmReleaseStatus struct { + // ObservedGeneration is the last observed generation. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // LastHandledReconcileAt is the last manual reconciliation request (by + // annotating the HelmRelease) handled by the reconciler. + // +optional + LastHandledReconcileAt string `json:"lastHandledReconcileAt,omitempty"` + + // Conditions holds the conditions for the HelmRelease. + // +optional + Conditions []meta.Condition `json:"conditions,omitempty"` + + // LastAppliedRevision is the revision of the last successfully applied source. + // +optional + LastAppliedRevision string `json:"lastAppliedRevision,omitempty"` + + // LastAttemptedRevision is the revision of the last reconciliation attempt. + // +optional + LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"` + + // LastAttemptedValuesChecksum is the SHA1 checksum of the values of the last + // reconciliation attempt. + // +optional + LastAttemptedValuesChecksum string `json:"lastAttemptedValuesChecksum,omitempty"` + + // LastReleaseRevision is the revision of the last successful Helm release. + // +optional + LastReleaseRevision int `json:"lastReleaseRevision,omitempty"` - // ReleasedCondition represents the fact that the HelmRelease has been successfully released. + // HelmChart is the namespaced name of the HelmChart resource created by + // the controller for the HelmRelease. + // +optional + HelmChart string `json:"helmChart,omitempty"` + + // Failures is the reconciliation failure count against the latest observed + // state. It is reset after a successful reconciliation. + // +optional + Failures int64 `json:"failures,omitempty"` + + // InstallFailures is the install failure count against the latest observed + // state. It is reset after a successful reconciliation. + // +optional + InstallFailures int64 `json:"installFailures,omitempty"` + + // UpgradeFailures is the upgrade failure count against the latest observed + // state. It is reset after a successful reconciliation. + // +optional + UpgradeFailures int64 `json:"upgradeFailures,omitempty"` +} +``` + +#### Condition types + +```go +const ( + // ReleasedCondition represents the fact that the HelmRelease has been + // successfully released. ReleasedCondition string = "Released" - // TestSuccessCondition represents the fact that the tests for the HelmRelease are succeeding. + // TestSuccessCondition represents the fact that the tests for the HelmRelease + // are succeeding. TestSuccessCondition string = "TestSuccess" - // RemediatedCondition represents the fact that the HelmRelease has been successfully remediated. + // RemediatedCondition represents the fact that the HelmRelease has been + // successfully remediated. RemediatedCondition string = "Remediated" ) ``` -Status condition reasons: +#### Condition reasons ```go const ( - // ReconciliationSucceededReason represents the fact that the reconciliation of the HelmRelease has succeeded. - ReconciliationSucceededReason string = "ReconciliationSucceeded" - - // ReconciliationFailedReason represents the fact that the reconciliation of the HelmRelease has failed. - ReconciliationFailedReason string = "ReconciliationFailed" - - // InstallSucceededReason represents the fact that the Helm install for the HelmRelease succeeded. + // InstallSucceededReason represents the fact that the Helm install for the + // HelmRelease succeeded. InstallSucceededReason string = "InstallSucceeded" - // InstallFailedReason represents the fact that the Helm install for the HelmRelease failed. + // InstallFailedReason represents the fact that the Helm install for the + // HelmRelease failed. InstallFailedReason string = "InstallFailed" - // UpgradeSucceededReason represents the fact that the Helm upgrade for the HelmRelease succeeded. + // UpgradeSucceededReason represents the fact that the Helm upgrade for the + // HelmRelease succeeded. UpgradeSucceededReason string = "UpgradeSucceeded" - // UpgradeFailedReason represents the fact that the Helm upgrade for the HelmRelease failed. + // UpgradeFailedReason represents the fact that the Helm upgrade for the + // HelmRelease failed. UpgradeFailedReason string = "UpgradeFailed" - // TestSucceededReason represents the fact that the Helm tests for the HelmRelease succeeded. + // TestSucceededReason represents the fact that the Helm tests for the + // HelmRelease succeeded. TestSucceededReason string = "TestSucceeded" - // TestFailedReason represents the fact that the Helm tests for the HelmRelease failed. + // TestFailedReason represents the fact that the Helm tests for the HelmRelease + // failed. TestFailedReason string = "TestsFailed" - // RollbackSucceededReason represents the fact that the Helm rollback for the HelmRelease succeeded. + // RollbackSucceededReason represents the fact that the Helm rollback for the + // HelmRelease succeeded. RollbackSucceededReason string = "RollbackSucceeded" - // RollbackFailedReason represents the fact that the Helm test for the HelmRelease failed. + // RollbackFailedReason represents the fact that the Helm test for the + // HelmRelease failed. RollbackFailedReason string = "RollbackFailed" - // UninstallSucceededReason represents the fact that the Helm uninstall for the HelmRelease succeeded. + // UninstallSucceededReason represents the fact that the Helm uninstall for the + // HelmRelease succeeded. UninstallSucceededReason string = "UninstallSucceeded" - // UninstallFailedReason represents the fact that the Helm uninstall for the HelmRelease failed. + // UninstallFailedReason represents the fact that the Helm uninstall for the + // HelmRelease failed. UninstallFailedReason string = "UninstallFailed" - // ArtifactFailedReason represents the fact that the artifact download for the HelmRelease failed. + // ArtifactFailedReason represents the fact that the artifact download for the + // HelmRelease failed. ArtifactFailedReason string = "ArtifactFailed" - // InitFailedReason represents the fact that the initialization of the Helm configuration failed. + // InitFailedReason represents the fact that the initialization of the Helm + // configuration failed. InitFailedReason string = "InitFailed" - // GetLastReleaseFailedReason represents the fact that observing the last release failed. + // GetLastReleaseFailedReason represents the fact that observing the last + // release failed. GetLastReleaseFailedReason string = "GetLastReleaseFailed" - - // ProgressingReason represents the fact that the reconciliation for the resource is underway. - ProgressingReason string = "Progressing" - - // DependencyNotReadyReason represents the fact that the one of the dependencies is not ready. - DependencyNotReadyReason string = "DependencyNotReady" - - // SuspendedReason represents the fact that the reconciliation of the HelmRelease is suspended. - SuspendedReason string = "Suspended" ) ``` @@ -473,17 +539,7 @@ interval time units are `s`, `m` and `h` e.g. `interval: 5m`, the minimum value The reconcilation can be suspended by setting `spec.susped` to `true`. The reconciler can be told to reconcile the `HelmRelease` outside of the specified interval -by annotating the object with: - -```go -const ( - // ReconcileAtAnnotation is the annotation used for triggering a - // reconciliation outside of the specified schedule. - ReconcileAtAnnotation string = "fluxcd.io/reconcileAt" -) -``` - -On-demand execution example: +by annotating the object: ```bash kubectl annotate --overwrite helmrelease/podinfo fluxcd.io/reconcileAt="$(date +%s)" diff --git a/go.mod b/go.mod index 7db3d1723..28e712aa9 100644 --- a/go.mod +++ b/go.mod @@ -6,18 +6,19 @@ replace github.com/fluxcd/helm-controller/api => ./api require ( github.com/fluxcd/helm-controller/api v0.0.10 + github.com/fluxcd/pkg/apis/meta v0.0.2 github.com/fluxcd/pkg/recorder v0.0.5 - github.com/fluxcd/pkg/runtime v0.0.3 + github.com/fluxcd/pkg/runtime v0.0.6 github.com/fluxcd/source-controller/api v0.0.18 github.com/go-logr/logr v0.1.0 github.com/onsi/ginkgo v1.12.1 github.com/onsi/gomega v1.10.1 go.uber.org/zap v1.13.0 helm.sh/helm/v3 v3.3.4 - k8s.io/api v0.18.8 - k8s.io/apimachinery v0.18.8 - k8s.io/cli-runtime v0.18.8 - k8s.io/client-go v0.18.8 + k8s.io/api v0.18.9 + k8s.io/apimachinery v0.18.9 + k8s.io/cli-runtime v0.18.9 + k8s.io/client-go v0.18.9 rsc.io/letsencrypt v0.0.3 // indirect - sigs.k8s.io/controller-runtime v0.6.2 + sigs.k8s.io/controller-runtime v0.6.3 ) diff --git a/go.sum b/go.sum index 18aec707e..bf43a8cfa 100644 --- a/go.sum +++ b/go.sum @@ -185,15 +185,21 @@ github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0 github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fluxcd/pkg/apis/meta v0.0.2 h1:kyA4Y0IzNjf1joBOnFqpWG7aNDHvtLExZcaHQM7qhRI= +github.com/fluxcd/pkg/apis/meta v0.0.2/go.mod h1:nCNps5JJOcEQr3MNDmZqI4o0chjePSUYL6Q2ktDtotU= github.com/fluxcd/pkg/recorder v0.0.5 h1:D8qfupahIvh6ncCMn2yTHsrzG91S05sp4zdpsbKWeaU= github.com/fluxcd/pkg/recorder v0.0.5/go.mod h1:2UG6EroZ6ZbqmqoL8k/cQMe09e6A36WyH4t4UDUGyuU= github.com/fluxcd/pkg/runtime v0.0.3 h1:x9rOThl1qh5srIUpW0YHEj1I84swMj5m76UqrR1QknY= github.com/fluxcd/pkg/runtime v0.0.3/go.mod h1:ECBTeplxhgbCJYIjmtwn3ZS0A91/+6YtOS4w2G0LeK4= +github.com/fluxcd/pkg/runtime v0.0.6 h1:m7qwr2wRePs1vzVlM0Y88vitXSsv1lb3QCJflRpa3qQ= +github.com/fluxcd/pkg/runtime v0.0.6/go.mod h1:iLjncjktQVpqpb1NsY2fW+UYDFOtVyt+yJrxqrrK8A0= github.com/fluxcd/source-controller/api v0.0.18 h1:9goqqsW3vhwO6Nxr8SNxIUW/5t1JL9cgIs4UctlaJVk= github.com/fluxcd/source-controller/api v0.0.18/go.mod h1:PUe+EYQ/s+KPnz2iOCgdf+L6clM0SWkyvdXIpbfpkQE= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -928,25 +934,39 @@ k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= k8s.io/api v0.18.8 h1:aIKUzJPb96f3fKec2lxtY7acZC9gQNDLVhfSGpxBAC4= k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= +k8s.io/api v0.18.9 h1:7VDtivqwbvLOf8hmXSd/PDSSbpCBq49MELg84EYBYiQ= +k8s.io/api v0.18.9/go.mod h1:9u/h6sUh6FxfErv7QqetX1EB3yBMIYOBXzdcf0Gf0rc= k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= k8s.io/apiextensions-apiserver v0.18.8 h1:pkqYPKTHa0/3lYwH7201RpF9eFm0lmZDFBNzhN+k/sA= k8s.io/apiextensions-apiserver v0.18.8/go.mod h1:7f4ySEkkvifIr4+BRrRWriKKIJjPyg9mb/p63dJKnlM= +k8s.io/apiextensions-apiserver v0.18.9 h1:tVEf8rVKh5BnXORnYYCztjbf6CSyGNMt/rAIEyfU00Q= +k8s.io/apiextensions-apiserver v0.18.9/go.mod h1:JagmAhU0TVENzgUZqHJsjCSDh7YuV5o6g01G1Fwh7zI= k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.8 h1:jimPrycCqgx2QPearX3to1JePz7wSbVLq+7PdBTTwQ0= k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= +k8s.io/apimachinery v0.18.9 h1:3ZABKQx3F3xPWlsGhCfUl8W+JXRRblV6Wo2A3zn0pvY= +k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM= +k8s.io/apiserver v0.18.9/go.mod h1:vXQzMtUCLsGg1Bh+7Jo2mZKHpHZFCZn8eTNSepcIA1M= k8s.io/cli-runtime v0.18.8 h1:ycmbN3hs7CfkJIYxJAOB10iW7BVPmXGXkfEyiV9NJ+k= k8s.io/cli-runtime v0.18.8/go.mod h1:7EzWiDbS9PFd0hamHHVoCY4GrokSTPSL32MA4rzIu0M= +k8s.io/cli-runtime v0.18.9 h1:ko+hFWGCgB3Ue3CPB/525btshO+Sya/D4qNSZ1Nu7J8= +k8s.io/cli-runtime v0.18.9/go.mod h1:Pw7UPmZd/wIlGd7DWGTUWA7qn92jCeybNeiS5WYJI6A= k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= k8s.io/client-go v0.18.8 h1:SdbLpIxk5j5YbFr1b7fq8S7mDgDjYmUxSbszyoesoDM= k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU= +k8s.io/client-go v0.18.9 h1:sPHX49yOtUqv1fl49TwV3f8cC0N3etSnwgFGsIsXnZc= +k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/code-generator v0.18.8/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= +k8s.io/code-generator v0.18.9/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= k8s.io/component-base v0.18.8 h1:BW5CORobxb6q5mb+YvdwQlyXXS6NVH5fDXWbU7tf2L8= k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU= +k8s.io/component-base v0.18.9 h1:7G0D/PUKrVxyUxjT5HV4aTqYqhPj60erA1ab1JUw7m8= +k8s.io/component-base v0.18.9/go.mod h1:tUo4qZtV8m7t/U+0DgY+fcnn4BFZ480fZdzxOkWH4zk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -969,6 +989,8 @@ rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA= sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E= +sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE= +sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= diff --git a/hack/api-docs/config.json b/hack/api-docs/config.json index 5ac73197e..363232048 100644 --- a/hack/api-docs/config.json +++ b/hack/api-docs/config.json @@ -22,13 +22,18 @@ { "typeMatchPrefix": "^github.com/fluxcd/pkg/runtime/dependency\\.CrossNamespaceDependencyReference$", "docsURLTemplate": "https://godoc.org/github.com/fluxcd/pkg/runtime/dependency#CrossNamespaceDependencyReference" + }, + { + "typeMatchPrefix": "^github.com/fluxcd/pkg/apis/meta\\.Condition$", + "docsURLTemplate": "https://godoc.org/github.com/fluxcd/pkg/apis/meta#Condition" } ], "typeDisplayNamePrefixOverrides": { "k8s.io/api/": "Kubernetes ", "k8s.io/apimachinery/pkg/apis/": "Kubernetes ", "k8s.io/apiextensions-apiserver/": "Kubernetes ", - "github.com/fluxcd/pkg/runtime/": "Runtime " + "github.com/fluxcd/pkg/runtime/": "Runtime ", + "github.com/fluxcd/pkg/apis/meta/": "Meta " }, "markdownDisabled": false }
(Optional) -

Timeout is the time to wait for any individual Kubernetes operation (like Jobs -for hooks) during the performance of a Helm upgrade action. Defaults to +

Timeout is the time to wait for any individual Kubernetes operation (like +Jobs for hooks) during the performance of a Helm upgrade action. Defaults to ‘HelmReleaseSpec.Timeout’.

(Optional) -

Remediation holds the remediation configuration for when the -Helm upgrade action for the HelmRelease fails. The default -is to not perform any action.

+

Remediation holds the remediation configuration for when the Helm upgrade +action for the HelmRelease fails. The default is to not perform any action.

(Optional) -

DisableWait disables the waiting for resources to be ready after a -Helm upgrade has been performed.

+

DisableWait disables the waiting for resources to be ready after a Helm +upgrade has been performed.

(Optional) -

DisableOpenAPIValidation prevents the Helm upgrade action from -validating rendered templates against the Kubernetes OpenAPI Schema.

+

DisableOpenAPIValidation prevents the Helm upgrade action from validating +rendered templates against the Kubernetes OpenAPI Schema.

(Optional) -

PreserveValues will make Helm reuse the last release’s values and merge -in overrides from ‘Values’. Setting this flag makes the HelmRelease +

PreserveValues will make Helm reuse the last release’s values and merge in +overrides from ‘Values’. Setting this flag makes the HelmRelease non-declarative.

(Optional) -

IgnoreTestFailures tells the controller to skip remediation when -the Helm tests are run after an upgrade action but fail. +

IgnoreTestFailures tells the controller to skip remediation when the Helm +tests are run after an upgrade action but fail. Defaults to ‘Test.IgnoreFailures’.

(Optional) -

RemediateLastFailure tells the controller to remediate the last -failure, when no retries remain. Defaults to ‘false’ unless ‘Retries’ -is greater than 0.

+

RemediateLastFailure tells the controller to remediate the last failure, when +no retries remain. Defaults to ‘false’ unless ‘Retries’ is greater than 0.

(Optional) -

Strategy to use for failure remediation. -Defaults to ‘rollback’.

+

Strategy to use for failure remediation. Defaults to ‘rollback’.

(Optional) -

ValuesKey is the data key where the values.yaml or a specific value can -be found at. Defaults to ‘values.yaml’.

+

ValuesKey is the data key where the values.yaml or a specific value can be +found at. Defaults to ‘values.yaml’.

(Optional) -

TargetPath is the YAML dot notation path the value should be merged at. -When set, the ValuesKey is expected to be a single flat value. -Defaults to ‘None’, which results in the values getting merged at the root.

+

TargetPath is the YAML dot notation path the value should be merged at. When +set, the ValuesKey is expected to be a single flat value. Defaults to ‘None’, +which results in the values getting merged at the root.

(Optional) -

Optional marks this ValuesReference as optional. When set, a not found -error for the values reference is ignored, but any ValuesKey, TargetPath or +

Optional marks this ValuesReference as optional. When set, a not found error +for the values reference is ignored, but any ValuesKey, TargetPath or transient error will still result in a reconciliation failure.