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:
@@ -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 getSourceGitCmdRun(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 getSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
||||
row = []string{
|
||||
source.GetName(),
|
||||
revision,
|
||||
string(corev1.ConditionFalse),
|
||||
string(metav1.ConditionFalse),
|
||||
"waiting to be reconciled",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user