-
Notifications
You must be signed in to change notification settings - Fork 1
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
Standardize convention for requesting namespaced resources #3288
Conversation
32394ff
to
bdb9359
Compare
@@ -293,7 +297,7 @@ service ClustersService { | |||
rpc ListSopsKustomizations(ListSopsKustomizationsRequest) | |||
returns (ListSopsKustomizationsResponse) { | |||
option (google.api.http) = { | |||
get : "/v1/sops-kustomizations" | |||
get : "/v1/clusters/{cluster_name}/sops-kustomizations" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sops-kustomizations are not namespaced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ListSopsKustomizationsRequest
, only cluster_name
is used 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is an inconsistency we should fix.
This endpoint should return all the sops-kustomizations even when a cluster is omitted. So lets put this back to /v1/sops-kustomizations
, and we can open an issue to stop it requiring a cluster filter.
@@ -276,7 +280,7 @@ service ClustersService { | |||
rpc GetPolicyConfig(GetPolicyConfigRequest) | |||
returns (GetPolicyConfigResponse) { | |||
option (google.api.http) = { | |||
get : "/v1/policy-configs/{name}" | |||
get : "/v1/clusters/{cluster_name}/policy-configs/{name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of policy stuff is not namespaced, policy-configs not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's not namespaced based the test deployments 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we should change this to `/v1/namespaces/{clusterNamespace}/clusters/{cluster_name}/policy-configs/{name}
}; | ||
} | ||
|
||
// List external secrets stores | ||
rpc ListExternalSecretStores(ListExternalSecretStoresRequest) | ||
returns (ListExternalSecretStoresResponse) { | ||
option (google.api.http) = { | ||
get : "/v1/external-secrets-stores" | ||
get : "/v1clusters/{cluster_name}/external-secrets-stores" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would guess these are namespaced too?
Sorry, these are just questsion! Maybe we add a collection of links to the PR description for non-namespaced resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay as /v1/external-secrets-stores
and we should lift the clusterName constraint in the future.
@@ -243,15 +246,16 @@ service ClustersService { | |||
rpc GetExternalSecret(GetExternalSecretRequest) | |||
returns (GetExternalSecretResponse) { | |||
option (google.api.http) = { | |||
get : "/v1/external-secrets/{external_secret_name}" | |||
get : "/v1/clusters/{cluster_name}/namespaces/{namespace}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/v1/namespaces/{clusterNamespace}/clusters/{cluster_name}/namespaces/{namespace}"
bdb9359
to
99c804d
Compare
- Small cleanup to getTemplates, don't need cluster namespace/name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! ⭐
Part of: #3220
What changed?
This PR standardizes the naming convention for requesting namespaced resources, in alignment with K8S practices. It specifically defines the structure for endpoints used to retrieve individual namespaced resources.
Example:
GET "/v1/clusters/{cluster_name}/namespaces/{namespace}/external-secrets/{external_secret_name}"
.Why was this change made?
This is part of the API clean up before publishing it for customer usage. It provides consistency in how namespaced resources are requested.
How was this change implemented?
How did you validate the change?
Explain how a reviewer can verify the change themselves
Integration tests -- what is covered, what cannot be covered;
or, explain why there are no new tests
Unit tests -- what is covered, what cannot be covered; are
there tests that fail without the change?
Release notes
Documentation Changes
Other follow ups