From 2078d048a16e5b1daa39af4952ead91bcbb1ddca Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Fri, 28 Aug 2020 15:20:34 +0200 Subject: [PATCH 1/2] Fix: change v1.JSON for HelmRelease to pointer --- cmd/tk/create_helmrelease.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tk/create_helmrelease.go b/cmd/tk/create_helmrelease.go index 8b96cd3a..9eebebd9 100644 --- a/cmd/tk/create_helmrelease.go +++ b/cmd/tk/create_helmrelease.go @@ -154,7 +154,7 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error { return fmt.Errorf("converting values to JSON from %s failed: %w", hrValuesFile, err) } - helmRelease.Spec.Values = apiextensionsv1.JSON{Raw: json} + helmRelease.Spec.Values = &apiextensionsv1.JSON{Raw: json} } if export { From e751bdc8a9be01d47e47af8452faf65c9b89534e Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 1 Sep 2020 11:15:53 +0200 Subject: [PATCH 2/2] Change readiness check for HelmRelease As the HelmRelease injects its own HelmChart, the first reconciliation will always trigger a `Ready==False` condition while it waits for the chart to become ready. Given this, we should only take this condition into account when the `status.LastAttemptedRevision` has been recorded, as this marks the fact that the chart is available and an action was attempted. --- cmd/tk/reconcile_helmrelease.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tk/reconcile_helmrelease.go b/cmd/tk/reconcile_helmrelease.go index 6ac4769b..fa4a4073 100644 --- a/cmd/tk/reconcile_helmrelease.go +++ b/cmd/tk/reconcile_helmrelease.go @@ -138,7 +138,7 @@ func isHelmReleaseReady(ctx context.Context, kubeClient client.Client, name, nam if condition.Type == helmv2.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil - } else if condition.Status == corev1.ConditionFalse { + } else if condition.Status == corev1.ConditionFalse && helmRelease.Status.LastAttemptedRevision != "" { return false, fmt.Errorf(condition.Message) } }