break before default

Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
This commit is contained in:
Raffael Sahli 2021-02-09 17:35:02 +01:00
parent bc3c4e2a36
commit 1e19503359
No known key found for this signature in database
GPG Key ID: 5E0BF46A67AD81C4
1 changed files with 5 additions and 7 deletions

View File

@ -403,13 +403,8 @@ func (r *HelmChartReconciler) reconcileFromHelmRepository(ctx context.Context,
if changed, err := helm.OverwriteChartDefaultValues(helmChart, valuesData); err != nil {
return sourcev1.HelmChartNotReady(chart, sourcev1.ChartPackageFailedReason, err.Error()), err
} else if !changed {
// No changes, write original package to storage
if err := r.Storage.AtomicWriteFile(&newArtifact, res, 0644); err != nil {
err = fmt.Errorf("unable to write chart file: %w", err)
return sourcev1.HelmChartNotReady(chart, sourcev1.StorageOperationFailedReason, err.Error()), err
}
break
// No changes, skip to write original package to storage
goto skipToDefault
}
// Create temporary working directory
@ -435,6 +430,9 @@ func (r *HelmChartReconciler) reconcileFromHelmRepository(ctx context.Context,
readyMessage = fmt.Sprintf("Fetched and packaged revision: %s", newArtifact.Revision)
readyReason = sourcev1.ChartPackageSucceededReason
break
skipToDefault:
fallthrough
default:
// Write artifact to storage
if err := r.Storage.AtomicWriteFile(&newArtifact, res, 0644); err != nil {