Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Multiple Namespaces #138

Merged
merged 12 commits into from
Sep 13, 2023
Merged

WIP: Multiple Namespaces #138

merged 12 commits into from
Sep 13, 2023

Conversation

victor-homedepot
Copy link
Contributor

@victor-homedepot victor-homedepot commented May 25, 2022

This is to address issue #128.

  • Deprecates the namespace field

  • Introduces namespaces field to replace namespace

  • Gracefully handles usage of deprecated field

  • Updates to ginkgo v2

  • Tests

  • Swagger Updated

  • Create new Table (see issue for details)

victor-homedepot and others added 7 commits May 10, 2022 14:10
- Deprecates the `namespace` field
- Adds support for multiple namespaces using the `namespaces` field
- Handles usage of deprecated field
- Updates ginkgo testing framework to v2
# Conflicts:
#	go.mod
#	go.sum
@alice485 alice485 marked this pull request as ready for review August 10, 2023 17:26
@guido9j guido9j requested a review from billiford August 10, 2023 19:30
@guido9j
Copy link

guido9j commented Aug 10, 2023

@billiford Can you review this PR? Thanks

Copy link
Collaborator

@billiford billiford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where we're actually utilizing the new Namespaces array, for example in deploy.go/patch.go, etc. Anything that references provider.Namespace now needs to references provider.Namespaces.

internal/sql/client.go Outdated Show resolved Hide resolved
Copy link

@guido9j guido9j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alice485
Copy link
Contributor

alice485 commented Sep 8, 2023

@billiford can you re-review? I've made the changes you requested

Copy link
Collaborator

@billiford billiford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't see where we're referencing the new Namespaces array. For example, in internal/kubernetes/provider.go on line 67 I see

if p.Namespace != nil {
	for _, value := range clusterScopedKinds {
		if strings.EqualFold(value, kind) {
			return fmt.Errorf("namespace-scoped account not allowed to access cluster-scoped kind: '%s'", kind)
		}
	}
}

When this should say if len(provider.Namespaces) > 0. I would just comment out the Namespace field to see where all it is used and change the logic accordingly.

@alice485
Copy link
Contributor

@billiford are you sure you're looking at the right version of the code? That file was already updated to reference len(p.Namespaces). It does also check p.Namespace there which I think Victor left in but I can take it out since it does end up being redundant.

if p.Namespace == nil && len(p.Namespaces) == 0 {

@billiford
Copy link
Collaborator

My bad, I was merging from the wrong branch.

Copy link
Collaborator

@billiford billiford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alice485 alice485 merged commit 7b63cb3 into master Sep 13, 2023
2 checks passed
@alice485 alice485 deleted the CN-1462/namespaces branch September 13, 2023 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants