1
0
mirror of synced 2026-02-13 13:06:56 +00:00

Refactor to adopt k8s standardized Condition type

Updates to use metav1.Condition type and removes references for
deprecated corev1.Condition* constants and uses the new k8s api/meta
helpers in place of the old pkg/apis/meta types.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
This commit is contained in:
Aurel Canciu
2020-11-17 16:48:29 +02:00
parent 3047b25193
commit 2a789ec705
24 changed files with 111 additions and 120 deletions

View File

@@ -26,7 +26,8 @@ import (
"github.com/fluxcd/pkg/apis/meta"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
@@ -78,7 +79,7 @@ func getHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
var rows [][]string
for _, helmRelease := range list.Items {
row := []string{}
if c := meta.GetCondition(helmRelease.Status.Conditions, meta.ReadyCondition); c != nil {
if c := apimeta.FindStatusCondition(helmRelease.Status.Conditions, meta.ReadyCondition); c != nil {
row = []string{
helmRelease.GetName(),
helmRelease.Status.LastAppliedRevision,
@@ -91,7 +92,7 @@ func getHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
helmRelease.GetName(),
helmRelease.Status.LastAppliedRevision,
strings.Title(strconv.FormatBool(helmRelease.Spec.Suspend)),
string(corev1.ConditionFalse),
string(metav1.ConditionFalse),
"waiting to be reconciled",
}
}