Skip to content

Commit

Permalink
refactor variablename and error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyvjoy committed Jun 3, 2024
1 parent 2eb8ab1 commit 40f6dc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ subjects:
roleRef:
kind: Role
name: connectivity-client-docker-k8s
apiGroup: rbac.authorization.k8s.io
apiGroup: rbac.authorization.k8s.io

7 changes: 3 additions & 4 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1180,14 +1180,13 @@ func getNamespaces(ctx context.Context, ctrlClient crclient.Client) ([]string, e
// Set to store unique namespaces
namespaceMap := make(map[string]struct{})

list := &csmv1.ContainerStorageModuleList{}
csmList := &csmv1.ContainerStorageModuleList{}

if err := ctrlClient.List(ctx, list); err != nil {
if err := ctrlClient.List(ctx, csmList); err != nil {
return nil, fmt.Errorf("list csm resources: %w", err)
}
for _, csmResource := range list.Items {
for _, csmResource := range csmList.Items {
namespaceMap[csmResource.Namespace] = struct{}{}
fmt.Printf("namespace is %s\n", csmResource.Namespace)
}

// Convert set to slice
Expand Down

0 comments on commit 40f6dc4

Please sign in to comment.