diff --git a/pkg/controllers/bucketController.go b/pkg/controllers/bucketController.go index 154c209..7b49e06 100644 --- a/pkg/controllers/bucketController.go +++ b/pkg/controllers/bucketController.go @@ -33,7 +33,6 @@ func BucketController( // check if v1 is supported _, err := dynamicClient.Resource(bucketResource).Namespace("").List(context.TODO(), metav1.ListOptions{}) if err != nil { - // try and possibly fail (bucket-controller is not mandatory) with v1beta2 bucketResource = bucketResourceV1beta2 } diff --git a/pkg/flux/flux.go b/pkg/flux/flux.go index 53547ae..4f948a7 100644 --- a/pkg/flux/flux.go +++ b/pkg/flux/flux.go @@ -459,7 +459,6 @@ func State(c *kubernetes.Clientset, dc *dynamic.DynamicClient) (*FluxState, erro buckets, err := dc.Resource(bucketGVR). Namespace(""). List(context.TODO(), metav1.ListOptions{}) - if err != nil { if strings.Contains(err.Error(), "the server could not find the requested resource") { // let's try the deprecated v1beta2 @@ -473,7 +472,6 @@ func State(c *kubernetes.Clientset, dc *dynamic.DynamicClient) (*FluxState, erro return nil, err } } - for _, repo := range buckets.Items { unstructured := repo.UnstructuredContent() var bucket sourcev1beta2.Bucket