diff --git a/internal/resourcemodifiers/resource_modifiers.go b/internal/resourcemodifiers/resource_modifiers.go index ef8194522..dbcd8e7ba 100644 --- a/internal/resourcemodifiers/resource_modifiers.go +++ b/internal/resourcemodifiers/resource_modifiers.go @@ -52,7 +52,7 @@ func GetResourceModifiersFromConfig(cm *v1.ConfigMap) (*ResourceModifiers, error return nil, fmt.Errorf("could not parse config from nil configmap") } if len(cm.Data) != 1 { - return nil, fmt.Errorf("illegal resource modifiers %s/%s configmap", cm.Name, cm.Namespace) + return nil, fmt.Errorf("illegal resource modifiers %s/%s configmap", cm.Namespace, cm.Name) } var yamlData string diff --git a/internal/resourcepolicies/resource_policies.go b/internal/resourcepolicies/resource_policies.go index 5da2da8fc..956a06753 100644 --- a/internal/resourcepolicies/resource_policies.go +++ b/internal/resourcepolicies/resource_policies.go @@ -132,7 +132,7 @@ func GetResourcePoliciesFromConfig(cm *v1.ConfigMap) (*Policies, error) { return nil, fmt.Errorf("could not parse config from nil configmap") } if len(cm.Data) != 1 { - return nil, fmt.Errorf("illegal resource policies %s/%s configmap", cm.Name, cm.Namespace) + return nil, fmt.Errorf("illegal resource policies %s/%s configmap", cm.Namespace, cm.Name) } var yamlData string diff --git a/internal/util/managercontroller/managercontroller.go b/internal/util/managercontroller/managercontroller.go deleted file mode 100644 index bb8082606..000000000 --- a/internal/util/managercontroller/managercontroller.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2020 the Velero contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// TODO(2.0) After converting all controllers to runtime-controller, -// the functions in this file will no longer be needed and should be removed. -package managercontroller - -import ( - "context" - - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/velero/pkg/controller" -) - -// Runnable will turn a "regular" runnable component (such as a controller) -// into a controller-runtime Runnable -func Runnable(p controller.Interface, numWorkers int) manager.Runnable { - // Pass the provided Context down to the run function. - f := func(ctx context.Context) error { - return p.Run(ctx, numWorkers) - } - return manager.RunnableFunc(f) -} diff --git a/pkg/cmd/cli/backuplocation/delete.go b/pkg/cmd/cli/backuplocation/delete.go index d34bfa8e5..922c32df9 100644 --- a/pkg/cmd/cli/backuplocation/delete.go +++ b/pkg/cmd/cli/backuplocation/delete.go @@ -33,8 +33,6 @@ import ( "github.com/vmware-tanzu/velero/pkg/cmd/cli" ) -const bslLabelKey = "velero.io/storage-location" - // NewDeleteCommand creates and returns a new cobra command for deleting backup-locations. func NewDeleteCommand(f client.Factory, use string) *cobra.Command { o := cli.NewDeleteOptions("backup-location") @@ -146,7 +144,7 @@ func findAssociatedBackups(client kbclient.Client, bslName, ns string) (velerov1 var backups velerov1api.BackupList err := client.List(context.Background(), &backups, &kbclient.ListOptions{ Namespace: ns, - Raw: &metav1.ListOptions{LabelSelector: bslLabelKey + "=" + bslName}, + Raw: &metav1.ListOptions{LabelSelector: velerov1api.StorageLocationLabel + "=" + bslName}, }) return backups, err } @@ -155,7 +153,7 @@ func findAssociatedBackupRepos(client kbclient.Client, bslName, ns string) (vele var repos velerov1api.BackupRepositoryList err := client.List(context.Background(), &repos, &kbclient.ListOptions{ Namespace: ns, - Raw: &metav1.ListOptions{LabelSelector: bslLabelKey + "=" + bslName}, + Raw: &metav1.ListOptions{LabelSelector: velerov1api.StorageLocationLabel + "=" + bslName}, }) return repos, err }