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

@@ -25,7 +25,8 @@ import (
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
"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"
)
@@ -78,7 +79,7 @@ func getSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
if source.GetArtifact() != nil {
revision = source.GetArtifact().Revision
}
if c := meta.GetCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
row = []string{
source.GetName(),
revision,
@@ -89,7 +90,7 @@ func getSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
row = []string{
source.GetName(),
revision,
string(corev1.ConditionFalse),
string(metav1.ConditionFalse),
"waiting to be reconciled",
}
}