Added support for helm waitForJobs

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Added support for helm waitForJobs

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Minor fixes

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Changed WaitForJobs to DisableWaitForJobs

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Minor fixes

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Changed WaitForJobs to DisableWaitForJobs

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Removed unnecessary update to v2alpha1

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>
This commit is contained in:
Santosh Kewat 2021-06-01 15:09:58 +05:30
parent 261fc6bda1
commit f48b8ab953
5 changed files with 87 additions and 0 deletions

View File

@ -319,6 +319,11 @@ type Install struct {
// +optional
DisableWait bool `json:"disableWait,omitempty"`
// DisableWaitForJobs disables waiting for jobs to complete after a Helm
// install has been performed.
// +optional
DisableWaitForJobs bool `json:"disableWaitForJobs,omitempty"`
// DisableHooks prevents hooks from running during the Helm install action.
// +optional
DisableHooks bool `json:"disableHooks,omitempty"`
@ -490,6 +495,11 @@ type Upgrade struct {
// +optional
DisableWait bool `json:"disableWait,omitempty"`
// DisableWaitForJobs disables waiting for jobs to complete after a Helm
// upgrade has been performed.
// +optional
DisableWaitForJobs bool `json:"disableWaitForJobs,omitempty"`
// DisableHooks prevents hooks from running during the Helm upgrade action.
// +optional
DisableHooks bool `json:"disableHooks,omitempty"`
@ -686,6 +696,11 @@ type Rollback struct {
// +optional
DisableWait bool `json:"disableWait,omitempty"`
// DisableWaitForJobs disables waiting for jobs to complete after a Helm
// rollback has been performed.
// +optional
DisableWaitForJobs bool `json:"disableWaitForJobs,omitempty"`
// DisableHooks prevents hooks from running during the Helm rollback action.
// +optional
DisableHooks bool `json:"disableHooks,omitempty"`

View File

@ -178,6 +178,10 @@ spec:
description: DisableWait disables the waiting for resources to
be ready after a Helm install has been performed.
type: boolean
disableWaitForJobs:
description: DisableWaitForJobs disables waiting for jobs to complete
after a Helm install has been performed.
type: boolean
remediation:
description: Remediation holds the remediation configuration for
when the Helm install action for the HelmRelease fails. The
@ -393,6 +397,10 @@ spec:
description: DisableWait disables the waiting for resources to
be ready after a Helm rollback has been performed.
type: boolean
disableWaitForJobs:
description: DisableWaitForJobs disables waiting for jobs to complete
after a Helm rollback has been performed.
type: boolean
force:
description: Force forces resource updates through a replacement
strategy.
@ -509,6 +517,10 @@ spec:
description: DisableWait disables the waiting for resources to
be ready after a Helm upgrade has been performed.
type: boolean
disableWaitForJobs:
description: DisableWaitForJobs disables waiting for jobs to complete
after a Helm upgrade has been performed.
type: boolean
force:
description: Force forces resource updates through a replacement
strategy.

View File

@ -1169,6 +1169,19 @@ install has been performed.</p>
</tr>
<tr>
<td>
<code>disableWaitForJobs</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>DisableWaitForJobs disables waiting for jobs to complete after a Helm
install has been performed.</p>
</td>
</tr>
<tr>
<td>
<code>disableHooks</code><br>
<em>
bool
@ -1526,6 +1539,19 @@ rollback has been performed.</p>
</tr>
<tr>
<td>
<code>disableWaitForJobs</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>DisableWaitForJobs disables waiting for jobs to complete after a Helm
rollback has been performed.</p>
</td>
</tr>
<tr>
<td>
<code>disableHooks</code><br>
<em>
bool
@ -1767,6 +1793,19 @@ upgrade has been performed.</p>
</tr>
<tr>
<td>
<code>disableWaitForJobs</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>DisableWaitForJobs disables waiting for jobs to complete after a Helm
upgrade has been performed.</p>
</td>
</tr>
<tr>
<td>
<code>disableHooks</code><br>
<em>
bool

View File

@ -190,6 +190,11 @@ type Install struct {
// +optional
DisableWait bool `json:"disableWait,omitempty"`
// DisableWaitForJobs disables waiting for jobs to complete after a Helm
// install has been performed.
// +optional
DisableWaitForJobs bool `json:"disableWaitForJobs,omitempty"`
// DisableHooks prevents hooks from running during the Helm install action.
// +optional
DisableHooks bool `json:"disableHooks,omitempty"`
@ -280,6 +285,11 @@ type Upgrade struct {
// +optional
DisableWait bool `json:"disableWait,omitempty"`
// DisableWaitForJobs disables waiting for jobs to complete after a Helm
// upgrade has been performed.
// +optional
DisableWaitForJobs bool `json:"disableWaitForJobs,omitempty"`
// DisableHooks prevents hooks from running during the Helm upgrade action.
// +optional
DisableHooks bool `json:"disableHooks,omitempty"`
@ -383,6 +393,11 @@ type Rollback struct {
// +optional
DisableWait bool `json:"disableWait,omitempty"`
// DisableWaitForJobs disables waiting for jobs to complete after a Helm
// rollback has been performed.
// +optional
DisableWaitForJobs bool `json:"disableWaitForJobs,omitempty"`
// DisableHooks prevents hooks from running during the Helm rollback action.
// +optional
DisableHooks bool `json:"disableHooks,omitempty"`
@ -770,6 +785,9 @@ kubectl get all --all-namespaces \
For install, upgrade, and rollback actions resource waiting is enabled by default,
but can be disabled by setting `spec.<action>.disableWait`.
Waiting for jobs to complete is enabled by default,
but can be disabled by setting `spec.<action>.disableWaitForJobs`.
### `HelmRelease` dependencies
When applying a `HelmRelease`, you may need to make sure other releases are [Ready](#status)

View File

@ -106,6 +106,7 @@ func (r *Runner) Install(hr v2.HelmRelease, chart *chart.Chart, values chartutil
install.Namespace = hr.GetReleaseNamespace()
install.Timeout = hr.Spec.GetInstall().GetTimeout(hr.GetTimeout()).Duration
install.Wait = !hr.Spec.GetInstall().DisableWait
install.WaitForJobs = !hr.Spec.GetInstall().DisableWaitForJobs
install.DisableHooks = hr.Spec.GetInstall().DisableHooks
install.DisableOpenAPIValidation = hr.Spec.GetInstall().DisableOpenAPIValidation
install.Replace = hr.Spec.GetInstall().Replace
@ -156,6 +157,7 @@ func (r *Runner) Upgrade(hr v2.HelmRelease, chart *chart.Chart, values chartutil
upgrade.MaxHistory = hr.GetMaxHistory()
upgrade.Timeout = hr.Spec.GetUpgrade().GetTimeout(hr.GetTimeout()).Duration
upgrade.Wait = !hr.Spec.GetUpgrade().DisableWait
upgrade.WaitForJobs = !hr.Spec.GetUpgrade().DisableWaitForJobs
upgrade.DisableHooks = hr.Spec.GetUpgrade().DisableHooks
upgrade.Force = hr.Spec.GetUpgrade().Force
upgrade.CleanupOnFail = hr.Spec.GetUpgrade().CleanupOnFail
@ -353,6 +355,7 @@ func (r *Runner) Rollback(hr v2.HelmRelease) error {
rollback := action.NewRollback(r.config)
rollback.Timeout = hr.Spec.GetRollback().GetTimeout(hr.GetTimeout()).Duration
rollback.Wait = !hr.Spec.GetRollback().DisableWait
rollback.WaitForJobs = !hr.Spec.GetRollback().DisableWaitForJobs
rollback.DisableHooks = hr.Spec.GetRollback().DisableHooks
rollback.Force = hr.Spec.GetRollback().Force
rollback.Recreate = hr.Spec.GetRollback().Recreate