From 4205e3dedcd5dbc7f6151db5c913bf81b4194a27 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Tue, 9 Feb 2021 11:57:34 -0500 Subject: [PATCH 01/15] Make concierge APIs cluster scoped Signed-off-by: Monis Khan --- .../authentication/v1alpha1/types_jwt.go.tmpl | 1 + .../v1alpha1/types_webhook.go.tmpl | 1 + .../v1alpha1/types_credentialissuer.go.tmpl | 1 + apis/concierge/login/types_token.go.tmpl | 1 - .../login/v1alpha1/types_token.go.tmpl | 1 + ...cierge.pinniped.dev_jwtauthenticators.yaml | 2 +- ...ge.pinniped.dev_webhookauthenticators.yaml | 2 +- ...cierge.pinniped.dev_credentialissuers.yaml | 2 +- internal/registry/credentialrequest/rest.go | 2 +- .../registry/credentialrequest/rest_test.go | 2 +- test/integration/kube_api_discovery_test.go | 25 ++++++++++++++++--- 11 files changed, 30 insertions(+), 10 deletions(-) diff --git a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl index 3e159148..480b1015 100644 --- a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl @@ -57,6 +57,7 @@ type JWTTokenClaims struct { // signature, existence of claims, etc.) and extract the username and groups from the token. // // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` diff --git a/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl index d12a1f3c..32062949 100644 --- a/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl @@ -29,6 +29,7 @@ type WebhookAuthenticatorSpec struct { // WebhookAuthenticator describes the configuration of a webhook authenticator. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` diff --git a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl index f462056d..c0425a79 100644 --- a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl +++ b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl @@ -67,6 +67,7 @@ type CredentialIssuerStrategy struct { // Describes the configuration status of a Pinniped credential issuer. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped type CredentialIssuer struct { diff --git a/apis/concierge/login/types_token.go.tmpl b/apis/concierge/login/types_token.go.tmpl index a0555f85..17a341b2 100644 --- a/apis/concierge/login/types_token.go.tmpl +++ b/apis/concierge/login/types_token.go.tmpl @@ -27,7 +27,6 @@ type TokenCredentialRequestStatus struct { } // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. -// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta diff --git a/apis/concierge/login/v1alpha1/types_token.go.tmpl b/apis/concierge/login/v1alpha1/types_token.go.tmpl index cb5965a2..66b744f3 100644 --- a/apis/concierge/login/v1alpha1/types_token.go.tmpl +++ b/apis/concierge/login/v1alpha1/types_token.go.tmpl @@ -30,6 +30,7 @@ type TokenCredentialRequestStatus struct { // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta `json:",inline"` diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..59facfd0 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: JWTAuthenticatorList plural: jwtauthenticators singular: jwtauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.issuer diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index d31bae12..a23e8fcf 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: WebhookAuthenticatorList plural: webhookauthenticators singular: webhookauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.endpoint diff --git a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml index 9b4c0056..87a454a7 100644 --- a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml @@ -16,7 +16,7 @@ spec: listKind: CredentialIssuerList plural: credentialissuers singular: credentialissuer - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: diff --git a/internal/registry/credentialrequest/rest.go b/internal/registry/credentialrequest/rest.go index dbe6821a..8b9d12ab 100644 --- a/internal/registry/credentialrequest/rest.go +++ b/internal/registry/credentialrequest/rest.go @@ -80,7 +80,7 @@ func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOpti } func (*REST) NamespaceScoped() bool { - return true + return false } func (*REST) Categories() []string { diff --git a/internal/registry/credentialrequest/rest_test.go b/internal/registry/credentialrequest/rest_test.go index b72af025..50652a02 100644 --- a/internal/registry/credentialrequest/rest_test.go +++ b/internal/registry/credentialrequest/rest_test.go @@ -31,7 +31,7 @@ import ( func TestNew(t *testing.T) { r := NewREST(nil, nil, schema.GroupResource{Group: "bears", Resource: "panda"}) require.NotNil(t, r) - require.True(t, r.NamespaceScoped()) + require.False(t, r.NamespaceScoped()) require.Equal(t, []string{"pinniped"}, r.Categories()) require.IsType(t, &loginapi.TokenCredentialRequest{}, r.New()) require.IsType(t, &loginapi.TokenCredentialRequestList{}, r.NewList()) diff --git a/test/integration/kube_api_discovery_test.go b/test/integration/kube_api_discovery_test.go index dba382bc..9bab7796 100644 --- a/test/integration/kube_api_discovery_test.go +++ b/test/integration/kube_api_discovery_test.go @@ -73,7 +73,7 @@ func TestGetAPIResourceList(t *testing.T) { Name: "tokencredentialrequests", Kind: "TokenCredentialRequest", Verbs: []string{"create", "list"}, - Namespaced: true, + Namespaced: false, Categories: []string{"pinniped"}, }, }, @@ -158,7 +158,7 @@ func TestGetAPIResourceList(t *testing.T) { { Name: "credentialissuers", SingularName: "credentialissuer", - Namespaced: true, + Namespaced: false, Kind: "CredentialIssuer", Verbs: []string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}, Categories: []string{"pinniped"}, @@ -185,7 +185,7 @@ func TestGetAPIResourceList(t *testing.T) { { Name: "webhookauthenticators", SingularName: "webhookauthenticator", - Namespaced: true, + Namespaced: false, Kind: "WebhookAuthenticator", Verbs: []string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}, Categories: []string{"pinniped", "pinniped-authenticator", "pinniped-authenticators"}, @@ -193,7 +193,7 @@ func TestGetAPIResourceList(t *testing.T) { { Name: "jwtauthenticators", SingularName: "jwtauthenticator", - Namespaced: true, + Namespaced: false, Kind: "JWTAuthenticator", Verbs: []string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}, Categories: []string{"pinniped", "pinniped-authenticator", "pinniped-authenticators"}, @@ -236,6 +236,23 @@ func TestGetAPIResourceList(t *testing.T) { } }) + t.Run("every concierge API is cluster scoped", func(t *testing.T) { + t.Parallel() + for _, r := range resources { + if !strings.Contains(r.GroupVersion, env.APIGroupSuffix) { + continue + } + + if !strings.Contains(r.GroupVersion, ".concierge.") { + continue + } + + for _, a := range r.APIResources { + assert.False(t, a.Namespaced, "concierge APIs must be cluster scoped: %#v", a) + } + } + }) + t.Run("Pinniped resources do not have short names", func(t *testing.T) { t.Parallel() for _, r := range resources { From d2480e63003cdd36a53026f64e79091a273c918e Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Tue, 9 Feb 2021 12:23:22 -0500 Subject: [PATCH 02/15] Generated Signed-off-by: Monis Khan --- ...cierge.pinniped.dev_jwtauthenticators.yaml | 2 +- ...ge.pinniped.dev_webhookauthenticators.yaml | 2 +- ...cierge.pinniped.dev_credentialissuers.yaml | 2 +- .../authentication/v1alpha1/types_jwt.go | 1 + .../authentication/v1alpha1/types_webhook.go | 1 + .../config/v1alpha1/types_credentialissuer.go | 1 + .../1.17/apis/concierge/login/types_token.go | 1 - .../concierge/login/v1alpha1/types_token.go | 1 + .../v1alpha1/authentication_client.go | 8 ++-- .../fake/fake_authentication_client.go | 8 ++-- .../v1alpha1/fake/fake_jwtauthenticator.go | 27 ++++-------- .../fake/fake_webhookauthenticator.go | 27 ++++-------- .../v1alpha1/jwtauthenticator.go | 15 +------ .../v1alpha1/webhookauthenticator.go | 15 +------ .../typed/config/v1alpha1/config_client.go | 4 +- .../typed/config/v1alpha1/credentialissuer.go | 15 +------ .../v1alpha1/fake/fake_config_client.go | 4 +- .../v1alpha1/fake/fake_credentialissuer.go | 27 ++++-------- .../login/v1alpha1/fake/fake_login_client.go | 4 +- .../fake/fake_tokencredentialrequest.go | 27 ++++-------- .../typed/login/v1alpha1/login_client.go | 4 +- .../login/v1alpha1/tokencredentialrequest.go | 15 +------ .../authentication/v1alpha1/interface.go | 4 +- .../v1alpha1/jwtauthenticator.go | 13 +++--- .../v1alpha1/webhookauthenticator.go | 13 +++--- .../config/v1alpha1/credentialissuer.go | 13 +++--- .../config/v1alpha1/interface.go | 2 +- .../login/v1alpha1/interface.go | 2 +- .../login/v1alpha1/tokencredentialrequest.go | 13 +++--- .../v1alpha1/expansion_generated.go | 8 ---- .../v1alpha1/jwtauthenticator.go | 39 +++-------------- .../v1alpha1/webhookauthenticator.go | 39 +++-------------- .../config/v1alpha1/credentialissuer.go | 39 +++-------------- .../config/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/tokencredentialrequest.go | 39 +++-------------- .../authentication/v1alpha1/types_jwt.go | 1 + .../authentication/v1alpha1/types_webhook.go | 1 + .../config/v1alpha1/types_credentialissuer.go | 1 + .../1.18/apis/concierge/login/types_token.go | 1 - .../concierge/login/v1alpha1/types_token.go | 1 + .../v1alpha1/authentication_client.go | 8 ++-- .../fake/fake_authentication_client.go | 8 ++-- .../v1alpha1/fake/fake_jwtauthenticator.go | 27 ++++-------- .../fake/fake_webhookauthenticator.go | 27 ++++-------- .../v1alpha1/jwtauthenticator.go | 15 +------ .../v1alpha1/webhookauthenticator.go | 15 +------ .../typed/config/v1alpha1/config_client.go | 4 +- .../typed/config/v1alpha1/credentialissuer.go | 15 +------ .../v1alpha1/fake/fake_config_client.go | 4 +- .../v1alpha1/fake/fake_credentialissuer.go | 27 ++++-------- .../login/v1alpha1/fake/fake_login_client.go | 4 +- .../fake/fake_tokencredentialrequest.go | 27 ++++-------- .../typed/login/v1alpha1/login_client.go | 4 +- .../login/v1alpha1/tokencredentialrequest.go | 15 +------ .../authentication/v1alpha1/interface.go | 4 +- .../v1alpha1/jwtauthenticator.go | 13 +++--- .../v1alpha1/webhookauthenticator.go | 13 +++--- .../config/v1alpha1/credentialissuer.go | 13 +++--- .../config/v1alpha1/interface.go | 2 +- .../login/v1alpha1/interface.go | 2 +- .../login/v1alpha1/tokencredentialrequest.go | 13 +++--- .../v1alpha1/expansion_generated.go | 8 ---- .../v1alpha1/jwtauthenticator.go | 39 +++-------------- .../v1alpha1/webhookauthenticator.go | 39 +++-------------- .../config/v1alpha1/credentialissuer.go | 39 +++-------------- .../config/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/tokencredentialrequest.go | 39 +++-------------- .../authentication/v1alpha1/types_jwt.go | 1 + .../authentication/v1alpha1/types_webhook.go | 1 + .../config/v1alpha1/types_credentialissuer.go | 1 + .../1.19/apis/concierge/login/types_token.go | 1 - .../concierge/login/v1alpha1/types_token.go | 1 + .../v1alpha1/authentication_client.go | 8 ++-- .../fake/fake_authentication_client.go | 8 ++-- .../v1alpha1/fake/fake_jwtauthenticator.go | 27 ++++-------- .../fake/fake_webhookauthenticator.go | 27 ++++-------- .../v1alpha1/jwtauthenticator.go | 15 +------ .../v1alpha1/webhookauthenticator.go | 15 +------ .../typed/config/v1alpha1/config_client.go | 4 +- .../typed/config/v1alpha1/credentialissuer.go | 15 +------ .../v1alpha1/fake/fake_config_client.go | 4 +- .../v1alpha1/fake/fake_credentialissuer.go | 27 ++++-------- .../login/v1alpha1/fake/fake_login_client.go | 4 +- .../fake/fake_tokencredentialrequest.go | 27 ++++-------- .../typed/login/v1alpha1/login_client.go | 4 +- .../login/v1alpha1/tokencredentialrequest.go | 15 +------ .../authentication/v1alpha1/interface.go | 4 +- .../v1alpha1/jwtauthenticator.go | 13 +++--- .../v1alpha1/webhookauthenticator.go | 13 +++--- .../config/v1alpha1/credentialissuer.go | 13 +++--- .../config/v1alpha1/interface.go | 2 +- .../login/v1alpha1/interface.go | 2 +- .../login/v1alpha1/tokencredentialrequest.go | 13 +++--- .../v1alpha1/expansion_generated.go | 8 ---- .../v1alpha1/jwtauthenticator.go | 43 +++---------------- .../v1alpha1/webhookauthenticator.go | 43 +++---------------- .../config/v1alpha1/credentialissuer.go | 43 +++---------------- .../config/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/tokencredentialrequest.go | 43 +++---------------- .../authentication/v1alpha1/types_jwt.go | 1 + .../authentication/v1alpha1/types_webhook.go | 1 + .../config/v1alpha1/types_credentialissuer.go | 1 + .../1.20/apis/concierge/login/types_token.go | 1 - .../concierge/login/v1alpha1/types_token.go | 1 + .../v1alpha1/authentication_client.go | 8 ++-- .../fake/fake_authentication_client.go | 8 ++-- .../v1alpha1/fake/fake_jwtauthenticator.go | 27 ++++-------- .../fake/fake_webhookauthenticator.go | 27 ++++-------- .../v1alpha1/jwtauthenticator.go | 15 +------ .../v1alpha1/webhookauthenticator.go | 15 +------ .../typed/config/v1alpha1/config_client.go | 4 +- .../typed/config/v1alpha1/credentialissuer.go | 15 +------ .../v1alpha1/fake/fake_config_client.go | 4 +- .../v1alpha1/fake/fake_credentialissuer.go | 27 ++++-------- .../login/v1alpha1/fake/fake_login_client.go | 4 +- .../fake/fake_tokencredentialrequest.go | 27 ++++-------- .../typed/login/v1alpha1/login_client.go | 4 +- .../login/v1alpha1/tokencredentialrequest.go | 15 +------ .../authentication/v1alpha1/interface.go | 4 +- .../v1alpha1/jwtauthenticator.go | 13 +++--- .../v1alpha1/webhookauthenticator.go | 13 +++--- .../config/v1alpha1/credentialissuer.go | 13 +++--- .../config/v1alpha1/interface.go | 2 +- .../login/v1alpha1/interface.go | 2 +- .../login/v1alpha1/tokencredentialrequest.go | 13 +++--- .../v1alpha1/expansion_generated.go | 8 ---- .../v1alpha1/jwtauthenticator.go | 43 +++---------------- .../v1alpha1/webhookauthenticator.go | 43 +++---------------- .../config/v1alpha1/credentialissuer.go | 43 +++---------------- .../config/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/expansion_generated.go | 4 -- .../login/v1alpha1/tokencredentialrequest.go | 43 +++---------------- 135 files changed, 459 insertions(+), 1327 deletions(-) diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index 59facfd0..e800411e 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: JWTAuthenticatorList plural: jwtauthenticators singular: jwtauthenticator - scope: Cluster + scope: Namespaced versions: - additionalPrinterColumns: - jsonPath: .spec.issuer diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index a23e8fcf..d31bae12 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: WebhookAuthenticatorList plural: webhookauthenticators singular: webhookauthenticator - scope: Cluster + scope: Namespaced versions: - additionalPrinterColumns: - jsonPath: .spec.endpoint diff --git a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml index 87a454a7..9b4c0056 100644 --- a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml @@ -16,7 +16,7 @@ spec: listKind: CredentialIssuerList plural: credentialissuers singular: credentialissuer - scope: Cluster + scope: Namespaced versions: - name: v1alpha1 schema: diff --git a/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go index 3e159148..480b1015 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,6 +57,7 @@ type JWTTokenClaims struct { // signature, existence of claims, etc.) and extract the username and groups from the token. // // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` diff --git a/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go index d12a1f3c..32062949 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,6 +29,7 @@ type WebhookAuthenticatorSpec struct { // WebhookAuthenticator describes the configuration of a webhook authenticator. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` diff --git a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go index f462056d..c0425a79 100644 --- a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,6 +67,7 @@ type CredentialIssuerStrategy struct { // Describes the configuration status of a Pinniped credential issuer. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped type CredentialIssuer struct { diff --git a/generated/1.17/apis/concierge/login/types_token.go b/generated/1.17/apis/concierge/login/types_token.go index a0555f85..17a341b2 100644 --- a/generated/1.17/apis/concierge/login/types_token.go +++ b/generated/1.17/apis/concierge/login/types_token.go @@ -27,7 +27,6 @@ type TokenCredentialRequestStatus struct { } // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. -// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta diff --git a/generated/1.17/apis/concierge/login/v1alpha1/types_token.go b/generated/1.17/apis/concierge/login/v1alpha1/types_token.go index cb5965a2..66b744f3 100644 --- a/generated/1.17/apis/concierge/login/v1alpha1/types_token.go +++ b/generated/1.17/apis/concierge/login/v1alpha1/types_token.go @@ -30,6 +30,7 @@ type TokenCredentialRequestStatus struct { // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go index 8b208477..a74d27a5 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go @@ -22,12 +22,12 @@ type AuthenticationV1alpha1Client struct { restClient rest.Interface } -func (c *AuthenticationV1alpha1Client) JWTAuthenticators(namespace string) JWTAuthenticatorInterface { - return newJWTAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) JWTAuthenticators() JWTAuthenticatorInterface { + return newJWTAuthenticators(c) } -func (c *AuthenticationV1alpha1Client) WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface { - return newWebhookAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) WebhookAuthenticators() WebhookAuthenticatorInterface { + return newWebhookAuthenticators(c) } // NewForConfig creates a new AuthenticationV1alpha1Client for the given config. diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go index 7b18dd14..4d8138b3 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go @@ -15,12 +15,12 @@ type FakeAuthenticationV1alpha1 struct { *testing.Fake } -func (c *FakeAuthenticationV1alpha1) JWTAuthenticators(namespace string) v1alpha1.JWTAuthenticatorInterface { - return &FakeJWTAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) JWTAuthenticators() v1alpha1.JWTAuthenticatorInterface { + return &FakeJWTAuthenticators{c} } -func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators(namespace string) v1alpha1.WebhookAuthenticatorInterface { - return &FakeWebhookAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators() v1alpha1.WebhookAuthenticatorInterface { + return &FakeWebhookAuthenticators{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go index af138a56..22286f3f 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go @@ -18,7 +18,6 @@ import ( // FakeJWTAuthenticators implements JWTAuthenticatorInterface type FakeJWTAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var jwtauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "jwtauthenticators"} @@ -28,8 +27,7 @@ var jwtauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.conci // Get takes name of the jWTAuthenticator, and returns the corresponding jWTAuthenticator object, and an error if there is any. func (c *FakeJWTAuthenticators) Get(name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootGetAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -39,8 +37,7 @@ func (c *FakeJWTAuthenticators) Get(name string, options v1.GetOptions) (result // List takes label and field selectors, and returns the list of JWTAuthenticators that match those selectors. func (c *FakeJWTAuthenticators) List(opts v1.ListOptions) (result *v1alpha1.JWTAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, c.ns, opts), &v1alpha1.JWTAuthenticatorList{}) - + Invokes(testing.NewRootListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, opts), &v1alpha1.JWTAuthenticatorList{}) if obj == nil { return nil, err } @@ -61,15 +58,13 @@ func (c *FakeJWTAuthenticators) List(opts v1.ListOptions) (result *v1alpha1.JWTA // Watch returns a watch.Interface that watches the requested jWTAuthenticators. func (c *FakeJWTAuthenticators) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(jwtauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(jwtauthenticatorsResource, opts)) } // Create takes the representation of a jWTAuthenticator and creates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Create(jWTAuthenticator *v1alpha1.JWTAuthenticator) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootCreateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -79,8 +74,7 @@ func (c *FakeJWTAuthenticators) Create(jWTAuthenticator *v1alpha1.JWTAuthenticat // Update takes the representation of a jWTAuthenticator and updates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Update(jWTAuthenticator *v1alpha1.JWTAuthenticator) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -91,8 +85,7 @@ func (c *FakeJWTAuthenticators) Update(jWTAuthenticator *v1alpha1.JWTAuthenticat // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeJWTAuthenticators) UpdateStatus(jWTAuthenticator *v1alpha1.JWTAuthenticator) (*v1alpha1.JWTAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jwtauthenticatorsResource, "status", c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(jwtauthenticatorsResource, "status", jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -102,14 +95,13 @@ func (c *FakeJWTAuthenticators) UpdateStatus(jWTAuthenticator *v1alpha1.JWTAuthe // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeJWTAuthenticators) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeJWTAuthenticators) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jwtauthenticatorsResource, c.ns, listOptions) + action := testing.NewRootDeleteCollectionAction(jwtauthenticatorsResource, listOptions) _, err := c.Fake.Invokes(action, &v1alpha1.JWTAuthenticatorList{}) return err @@ -118,8 +110,7 @@ func (c *FakeJWTAuthenticators) DeleteCollection(options *v1.DeleteOptions, list // Patch applies the patch and returns the patched jWTAuthenticator. func (c *FakeJWTAuthenticators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jwtauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(jwtauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go index e79d48c2..e1e12398 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go @@ -18,7 +18,6 @@ import ( // FakeWebhookAuthenticators implements WebhookAuthenticatorInterface type FakeWebhookAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var webhookauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "webhookauthenticators"} @@ -28,8 +27,7 @@ var webhookauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.c // Get takes name of the webhookAuthenticator, and returns the corresponding webhookAuthenticator object, and an error if there is any. func (c *FakeWebhookAuthenticators) Get(name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootGetAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -39,8 +37,7 @@ func (c *FakeWebhookAuthenticators) Get(name string, options v1.GetOptions) (res // List takes label and field selectors, and returns the list of WebhookAuthenticators that match those selectors. func (c *FakeWebhookAuthenticators) List(opts v1.ListOptions) (result *v1alpha1.WebhookAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, c.ns, opts), &v1alpha1.WebhookAuthenticatorList{}) - + Invokes(testing.NewRootListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, opts), &v1alpha1.WebhookAuthenticatorList{}) if obj == nil { return nil, err } @@ -61,15 +58,13 @@ func (c *FakeWebhookAuthenticators) List(opts v1.ListOptions) (result *v1alpha1. // Watch returns a watch.Interface that watches the requested webhookAuthenticators. func (c *FakeWebhookAuthenticators) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(webhookauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(webhookauthenticatorsResource, opts)) } // Create takes the representation of a webhookAuthenticator and creates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Create(webhookAuthenticator *v1alpha1.WebhookAuthenticator) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootCreateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -79,8 +74,7 @@ func (c *FakeWebhookAuthenticators) Create(webhookAuthenticator *v1alpha1.Webhoo // Update takes the representation of a webhookAuthenticator and updates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Update(webhookAuthenticator *v1alpha1.WebhookAuthenticator) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -91,8 +85,7 @@ func (c *FakeWebhookAuthenticators) Update(webhookAuthenticator *v1alpha1.Webhoo // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeWebhookAuthenticators) UpdateStatus(webhookAuthenticator *v1alpha1.WebhookAuthenticator) (*v1alpha1.WebhookAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(webhookauthenticatorsResource, "status", c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(webhookauthenticatorsResource, "status", webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -102,14 +95,13 @@ func (c *FakeWebhookAuthenticators) UpdateStatus(webhookAuthenticator *v1alpha1. // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeWebhookAuthenticators) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeWebhookAuthenticators) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(webhookauthenticatorsResource, c.ns, listOptions) + action := testing.NewRootDeleteCollectionAction(webhookauthenticatorsResource, listOptions) _, err := c.Fake.Invokes(action, &v1alpha1.WebhookAuthenticatorList{}) return err @@ -118,8 +110,7 @@ func (c *FakeWebhookAuthenticators) DeleteCollection(options *v1.DeleteOptions, // Patch applies the patch and returns the patched webhookAuthenticator. func (c *FakeWebhookAuthenticators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(webhookauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(webhookauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go index 9da49bc1..aae83492 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go @@ -19,7 +19,7 @@ import ( // JWTAuthenticatorsGetter has a method to return a JWTAuthenticatorInterface. // A group's client should implement this interface. type JWTAuthenticatorsGetter interface { - JWTAuthenticators(namespace string) JWTAuthenticatorInterface + JWTAuthenticators() JWTAuthenticatorInterface } // JWTAuthenticatorInterface has methods to work with JWTAuthenticator resources. @@ -39,14 +39,12 @@ type JWTAuthenticatorInterface interface { // jWTAuthenticators implements JWTAuthenticatorInterface type jWTAuthenticators struct { client rest.Interface - ns string } // newJWTAuthenticators returns a JWTAuthenticators -func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jWTAuthenticators { +func newJWTAuthenticators(c *AuthenticationV1alpha1Client) *jWTAuthenticators { return &jWTAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -54,7 +52,6 @@ func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jW func (c *jWTAuthenticators) Get(name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -71,7 +68,6 @@ func (c *jWTAuthenticators) List(opts v1.ListOptions) (result *v1alpha1.JWTAuthe } result = &v1alpha1.JWTAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -88,7 +84,6 @@ func (c *jWTAuthenticators) Watch(opts v1.ListOptions) (watch.Interface, error) } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -99,7 +94,6 @@ func (c *jWTAuthenticators) Watch(opts v1.ListOptions) (watch.Interface, error) func (c *jWTAuthenticators) Create(jWTAuthenticator *v1alpha1.JWTAuthenticator) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("jwtauthenticators"). Body(jWTAuthenticator). Do(). @@ -111,7 +105,6 @@ func (c *jWTAuthenticators) Create(jWTAuthenticator *v1alpha1.JWTAuthenticator) func (c *jWTAuthenticators) Update(jWTAuthenticator *v1alpha1.JWTAuthenticator) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). Body(jWTAuthenticator). @@ -126,7 +119,6 @@ func (c *jWTAuthenticators) Update(jWTAuthenticator *v1alpha1.JWTAuthenticator) func (c *jWTAuthenticators) UpdateStatus(jWTAuthenticator *v1alpha1.JWTAuthenticator) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). SubResource("status"). @@ -139,7 +131,6 @@ func (c *jWTAuthenticators) UpdateStatus(jWTAuthenticator *v1alpha1.JWTAuthentic // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *jWTAuthenticators) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). Body(options). @@ -154,7 +145,6 @@ func (c *jWTAuthenticators) DeleteCollection(options *v1.DeleteOptions, listOpti timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&listOptions, scheme.ParameterCodec). Timeout(timeout). @@ -167,7 +157,6 @@ func (c *jWTAuthenticators) DeleteCollection(options *v1.DeleteOptions, listOpti func (c *jWTAuthenticators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("jwtauthenticators"). SubResource(subresources...). Name(name). diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go index 30e30851..69a42088 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go @@ -19,7 +19,7 @@ import ( // WebhookAuthenticatorsGetter has a method to return a WebhookAuthenticatorInterface. // A group's client should implement this interface. type WebhookAuthenticatorsGetter interface { - WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface + WebhookAuthenticators() WebhookAuthenticatorInterface } // WebhookAuthenticatorInterface has methods to work with WebhookAuthenticator resources. @@ -39,14 +39,12 @@ type WebhookAuthenticatorInterface interface { // webhookAuthenticators implements WebhookAuthenticatorInterface type webhookAuthenticators struct { client rest.Interface - ns string } // newWebhookAuthenticators returns a WebhookAuthenticators -func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *webhookAuthenticators { +func newWebhookAuthenticators(c *AuthenticationV1alpha1Client) *webhookAuthenticators { return &webhookAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -54,7 +52,6 @@ func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) func (c *webhookAuthenticators) Get(name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -71,7 +68,6 @@ func (c *webhookAuthenticators) List(opts v1.ListOptions) (result *v1alpha1.Webh } result = &v1alpha1.WebhookAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -88,7 +84,6 @@ func (c *webhookAuthenticators) Watch(opts v1.ListOptions) (watch.Interface, err } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -99,7 +94,6 @@ func (c *webhookAuthenticators) Watch(opts v1.ListOptions) (watch.Interface, err func (c *webhookAuthenticators) Create(webhookAuthenticator *v1alpha1.WebhookAuthenticator) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("webhookauthenticators"). Body(webhookAuthenticator). Do(). @@ -111,7 +105,6 @@ func (c *webhookAuthenticators) Create(webhookAuthenticator *v1alpha1.WebhookAut func (c *webhookAuthenticators) Update(webhookAuthenticator *v1alpha1.WebhookAuthenticator) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). Body(webhookAuthenticator). @@ -126,7 +119,6 @@ func (c *webhookAuthenticators) Update(webhookAuthenticator *v1alpha1.WebhookAut func (c *webhookAuthenticators) UpdateStatus(webhookAuthenticator *v1alpha1.WebhookAuthenticator) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). SubResource("status"). @@ -139,7 +131,6 @@ func (c *webhookAuthenticators) UpdateStatus(webhookAuthenticator *v1alpha1.Webh // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *webhookAuthenticators) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). Body(options). @@ -154,7 +145,6 @@ func (c *webhookAuthenticators) DeleteCollection(options *v1.DeleteOptions, list timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&listOptions, scheme.ParameterCodec). Timeout(timeout). @@ -167,7 +157,6 @@ func (c *webhookAuthenticators) DeleteCollection(options *v1.DeleteOptions, list func (c *webhookAuthenticators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("webhookauthenticators"). SubResource(subresources...). Name(name). diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go index 3980e6ed..0cb0e891 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go @@ -21,8 +21,8 @@ type ConfigV1alpha1Client struct { restClient rest.Interface } -func (c *ConfigV1alpha1Client) CredentialIssuers(namespace string) CredentialIssuerInterface { - return newCredentialIssuers(c, namespace) +func (c *ConfigV1alpha1Client) CredentialIssuers() CredentialIssuerInterface { + return newCredentialIssuers(c) } // NewForConfig creates a new ConfigV1alpha1Client for the given config. diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go index 444f1264..6453ed63 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go @@ -19,7 +19,7 @@ import ( // CredentialIssuersGetter has a method to return a CredentialIssuerInterface. // A group's client should implement this interface. type CredentialIssuersGetter interface { - CredentialIssuers(namespace string) CredentialIssuerInterface + CredentialIssuers() CredentialIssuerInterface } // CredentialIssuerInterface has methods to work with CredentialIssuer resources. @@ -39,14 +39,12 @@ type CredentialIssuerInterface interface { // credentialIssuers implements CredentialIssuerInterface type credentialIssuers struct { client rest.Interface - ns string } // newCredentialIssuers returns a CredentialIssuers -func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credentialIssuers { +func newCredentialIssuers(c *ConfigV1alpha1Client) *credentialIssuers { return &credentialIssuers{ client: c.RESTClient(), - ns: namespace, } } @@ -54,7 +52,6 @@ func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credential func (c *credentialIssuers) Get(name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -71,7 +68,6 @@ func (c *credentialIssuers) List(opts v1.ListOptions) (result *v1alpha1.Credenti } result = &v1alpha1.CredentialIssuerList{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -88,7 +84,6 @@ func (c *credentialIssuers) Watch(opts v1.ListOptions) (watch.Interface, error) } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -99,7 +94,6 @@ func (c *credentialIssuers) Watch(opts v1.ListOptions) (watch.Interface, error) func (c *credentialIssuers) Create(credentialIssuer *v1alpha1.CredentialIssuer) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Post(). - Namespace(c.ns). Resource("credentialissuers"). Body(credentialIssuer). Do(). @@ -111,7 +105,6 @@ func (c *credentialIssuers) Create(credentialIssuer *v1alpha1.CredentialIssuer) func (c *credentialIssuers) Update(credentialIssuer *v1alpha1.CredentialIssuer) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). Body(credentialIssuer). @@ -126,7 +119,6 @@ func (c *credentialIssuers) Update(credentialIssuer *v1alpha1.CredentialIssuer) func (c *credentialIssuers) UpdateStatus(credentialIssuer *v1alpha1.CredentialIssuer) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). SubResource("status"). @@ -139,7 +131,6 @@ func (c *credentialIssuers) UpdateStatus(credentialIssuer *v1alpha1.CredentialIs // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *credentialIssuers) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). Body(options). @@ -154,7 +145,6 @@ func (c *credentialIssuers) DeleteCollection(options *v1.DeleteOptions, listOpti timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&listOptions, scheme.ParameterCodec). Timeout(timeout). @@ -167,7 +157,6 @@ func (c *credentialIssuers) DeleteCollection(options *v1.DeleteOptions, listOpti func (c *credentialIssuers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("credentialissuers"). SubResource(subresources...). Name(name). diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go index 2129c5e7..0a45e3f8 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go @@ -15,8 +15,8 @@ type FakeConfigV1alpha1 struct { *testing.Fake } -func (c *FakeConfigV1alpha1) CredentialIssuers(namespace string) v1alpha1.CredentialIssuerInterface { - return &FakeCredentialIssuers{c, namespace} +func (c *FakeConfigV1alpha1) CredentialIssuers() v1alpha1.CredentialIssuerInterface { + return &FakeCredentialIssuers{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go index 99427907..17733599 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go @@ -18,7 +18,6 @@ import ( // FakeCredentialIssuers implements CredentialIssuerInterface type FakeCredentialIssuers struct { Fake *FakeConfigV1alpha1 - ns string } var credentialissuersResource = schema.GroupVersionResource{Group: "config.concierge.pinniped.dev", Version: "v1alpha1", Resource: "credentialissuers"} @@ -28,8 +27,7 @@ var credentialissuersKind = schema.GroupVersionKind{Group: "config.concierge.pin // Get takes name of the credentialIssuer, and returns the corresponding credentialIssuer object, and an error if there is any. func (c *FakeCredentialIssuers) Get(name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootGetAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -39,8 +37,7 @@ func (c *FakeCredentialIssuers) Get(name string, options v1.GetOptions) (result // List takes label and field selectors, and returns the list of CredentialIssuers that match those selectors. func (c *FakeCredentialIssuers) List(opts v1.ListOptions) (result *v1alpha1.CredentialIssuerList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(credentialissuersResource, credentialissuersKind, c.ns, opts), &v1alpha1.CredentialIssuerList{}) - + Invokes(testing.NewRootListAction(credentialissuersResource, credentialissuersKind, opts), &v1alpha1.CredentialIssuerList{}) if obj == nil { return nil, err } @@ -61,15 +58,13 @@ func (c *FakeCredentialIssuers) List(opts v1.ListOptions) (result *v1alpha1.Cred // Watch returns a watch.Interface that watches the requested credentialIssuers. func (c *FakeCredentialIssuers) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(credentialissuersResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(credentialissuersResource, opts)) } // Create takes the representation of a credentialIssuer and creates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Create(credentialIssuer *v1alpha1.CredentialIssuer) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootCreateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -79,8 +74,7 @@ func (c *FakeCredentialIssuers) Create(credentialIssuer *v1alpha1.CredentialIssu // Update takes the representation of a credentialIssuer and updates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Update(credentialIssuer *v1alpha1.CredentialIssuer) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -91,8 +85,7 @@ func (c *FakeCredentialIssuers) Update(credentialIssuer *v1alpha1.CredentialIssu // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCredentialIssuers) UpdateStatus(credentialIssuer *v1alpha1.CredentialIssuer) (*v1alpha1.CredentialIssuer, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(credentialissuersResource, "status", c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateSubresourceAction(credentialissuersResource, "status", credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -102,14 +95,13 @@ func (c *FakeCredentialIssuers) UpdateStatus(credentialIssuer *v1alpha1.Credenti // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *FakeCredentialIssuers) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootDeleteAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCredentialIssuers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(credentialissuersResource, c.ns, listOptions) + action := testing.NewRootDeleteCollectionAction(credentialissuersResource, listOptions) _, err := c.Fake.Invokes(action, &v1alpha1.CredentialIssuerList{}) return err @@ -118,8 +110,7 @@ func (c *FakeCredentialIssuers) DeleteCollection(options *v1.DeleteOptions, list // Patch applies the patch and returns the patched credentialIssuer. func (c *FakeCredentialIssuers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(credentialissuersResource, c.ns, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootPatchSubresourceAction(credentialissuersResource, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go index f4050ab3..dcc48c9c 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go @@ -15,8 +15,8 @@ type FakeLoginV1alpha1 struct { *testing.Fake } -func (c *FakeLoginV1alpha1) TokenCredentialRequests(namespace string) v1alpha1.TokenCredentialRequestInterface { - return &FakeTokenCredentialRequests{c, namespace} +func (c *FakeLoginV1alpha1) TokenCredentialRequests() v1alpha1.TokenCredentialRequestInterface { + return &FakeTokenCredentialRequests{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go index dc92fe35..7f3a8b11 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go @@ -18,7 +18,6 @@ import ( // FakeTokenCredentialRequests implements TokenCredentialRequestInterface type FakeTokenCredentialRequests struct { Fake *FakeLoginV1alpha1 - ns string } var tokencredentialrequestsResource = schema.GroupVersionResource{Group: "login.concierge.pinniped.dev", Version: "v1alpha1", Resource: "tokencredentialrequests"} @@ -28,8 +27,7 @@ var tokencredentialrequestsKind = schema.GroupVersionKind{Group: "login.concierg // Get takes name of the tokenCredentialRequest, and returns the corresponding tokenCredentialRequest object, and an error if there is any. func (c *FakeTokenCredentialRequests) Get(name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootGetAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -39,8 +37,7 @@ func (c *FakeTokenCredentialRequests) Get(name string, options v1.GetOptions) (r // List takes label and field selectors, and returns the list of TokenCredentialRequests that match those selectors. func (c *FakeTokenCredentialRequests) List(opts v1.ListOptions) (result *v1alpha1.TokenCredentialRequestList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, c.ns, opts), &v1alpha1.TokenCredentialRequestList{}) - + Invokes(testing.NewRootListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, opts), &v1alpha1.TokenCredentialRequestList{}) if obj == nil { return nil, err } @@ -61,15 +58,13 @@ func (c *FakeTokenCredentialRequests) List(opts v1.ListOptions) (result *v1alpha // Watch returns a watch.Interface that watches the requested tokenCredentialRequests. func (c *FakeTokenCredentialRequests) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tokencredentialrequestsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(tokencredentialrequestsResource, opts)) } // Create takes the representation of a tokenCredentialRequest and creates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Create(tokenCredentialRequest *v1alpha1.TokenCredentialRequest) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootCreateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -79,8 +74,7 @@ func (c *FakeTokenCredentialRequests) Create(tokenCredentialRequest *v1alpha1.To // Update takes the representation of a tokenCredentialRequest and updates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Update(tokenCredentialRequest *v1alpha1.TokenCredentialRequest) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -91,8 +85,7 @@ func (c *FakeTokenCredentialRequests) Update(tokenCredentialRequest *v1alpha1.To // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeTokenCredentialRequests) UpdateStatus(tokenCredentialRequest *v1alpha1.TokenCredentialRequest) (*v1alpha1.TokenCredentialRequest, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tokencredentialrequestsResource, "status", c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateSubresourceAction(tokencredentialrequestsResource, "status", tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -102,14 +95,13 @@ func (c *FakeTokenCredentialRequests) UpdateStatus(tokenCredentialRequest *v1alp // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *FakeTokenCredentialRequests) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootDeleteAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeTokenCredentialRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tokencredentialrequestsResource, c.ns, listOptions) + action := testing.NewRootDeleteCollectionAction(tokencredentialrequestsResource, listOptions) _, err := c.Fake.Invokes(action, &v1alpha1.TokenCredentialRequestList{}) return err @@ -118,8 +110,7 @@ func (c *FakeTokenCredentialRequests) DeleteCollection(options *v1.DeleteOptions // Patch applies the patch and returns the patched tokenCredentialRequest. func (c *FakeTokenCredentialRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tokencredentialrequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootPatchSubresourceAction(tokencredentialrequestsResource, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go index 9ff384ba..a05d2b48 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go @@ -21,8 +21,8 @@ type LoginV1alpha1Client struct { restClient rest.Interface } -func (c *LoginV1alpha1Client) TokenCredentialRequests(namespace string) TokenCredentialRequestInterface { - return newTokenCredentialRequests(c, namespace) +func (c *LoginV1alpha1Client) TokenCredentialRequests() TokenCredentialRequestInterface { + return newTokenCredentialRequests(c) } // NewForConfig creates a new LoginV1alpha1Client for the given config. diff --git a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go index c64db064..4f419607 100644 --- a/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.17/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go @@ -19,7 +19,7 @@ import ( // TokenCredentialRequestsGetter has a method to return a TokenCredentialRequestInterface. // A group's client should implement this interface. type TokenCredentialRequestsGetter interface { - TokenCredentialRequests(namespace string) TokenCredentialRequestInterface + TokenCredentialRequests() TokenCredentialRequestInterface } // TokenCredentialRequestInterface has methods to work with TokenCredentialRequest resources. @@ -39,14 +39,12 @@ type TokenCredentialRequestInterface interface { // tokenCredentialRequests implements TokenCredentialRequestInterface type tokenCredentialRequests struct { client rest.Interface - ns string } // newTokenCredentialRequests returns a TokenCredentialRequests -func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *tokenCredentialRequests { +func newTokenCredentialRequests(c *LoginV1alpha1Client) *tokenCredentialRequests { return &tokenCredentialRequests{ client: c.RESTClient(), - ns: namespace, } } @@ -54,7 +52,6 @@ func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *token func (c *tokenCredentialRequests) Get(name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -71,7 +68,6 @@ func (c *tokenCredentialRequests) List(opts v1.ListOptions) (result *v1alpha1.To } result = &v1alpha1.TokenCredentialRequestList{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -88,7 +84,6 @@ func (c *tokenCredentialRequests) Watch(opts v1.ListOptions) (watch.Interface, e } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -99,7 +94,6 @@ func (c *tokenCredentialRequests) Watch(opts v1.ListOptions) (watch.Interface, e func (c *tokenCredentialRequests) Create(tokenCredentialRequest *v1alpha1.TokenCredentialRequest) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Post(). - Namespace(c.ns). Resource("tokencredentialrequests"). Body(tokenCredentialRequest). Do(). @@ -111,7 +105,6 @@ func (c *tokenCredentialRequests) Create(tokenCredentialRequest *v1alpha1.TokenC func (c *tokenCredentialRequests) Update(tokenCredentialRequest *v1alpha1.TokenCredentialRequest) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). Body(tokenCredentialRequest). @@ -126,7 +119,6 @@ func (c *tokenCredentialRequests) Update(tokenCredentialRequest *v1alpha1.TokenC func (c *tokenCredentialRequests) UpdateStatus(tokenCredentialRequest *v1alpha1.TokenCredentialRequest) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). SubResource("status"). @@ -139,7 +131,6 @@ func (c *tokenCredentialRequests) UpdateStatus(tokenCredentialRequest *v1alpha1. // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *tokenCredentialRequests) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). Body(options). @@ -154,7 +145,6 @@ func (c *tokenCredentialRequests) DeleteCollection(options *v1.DeleteOptions, li timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&listOptions, scheme.ParameterCodec). Timeout(timeout). @@ -167,7 +157,6 @@ func (c *tokenCredentialRequests) DeleteCollection(options *v1.DeleteOptions, li func (c *tokenCredentialRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("tokencredentialrequests"). SubResource(subresources...). Name(name). diff --git a/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go b/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go index 2c07b2b2..4ba9d2c8 100644 --- a/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go +++ b/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go @@ -30,10 +30,10 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // JWTAuthenticators returns a JWTAuthenticatorInformer. func (v *version) JWTAuthenticators() JWTAuthenticatorInformer { - return &jWTAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &jWTAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // WebhookAuthenticators returns a WebhookAuthenticatorInformer. func (v *version) WebhookAuthenticators() WebhookAuthenticatorInformer { - return &webhookAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &webhookAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go b/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go index 8dad55a1..842492d3 100644 --- a/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go @@ -28,33 +28,32 @@ type JWTAuthenticatorInformer interface { type jWTAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).List(options) + return client.AuthenticationV1alpha1().JWTAuthenticators().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).Watch(options) + return client.AuthenticationV1alpha1().JWTAuthenticators().Watch(options) }, }, &authenticationv1alpha1.JWTAuthenticator{}, @@ -64,7 +63,7 @@ func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace s } func (f *jWTAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *jWTAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go b/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go index 605d0e16..6f835aec 100644 --- a/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.17/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go @@ -28,33 +28,32 @@ type WebhookAuthenticatorInformer interface { type webhookAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).List(options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).Watch(options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().Watch(options) }, }, &authenticationv1alpha1.WebhookAuthenticator{}, @@ -64,7 +63,7 @@ func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespa } func (f *webhookAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *webhookAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go b/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go index 9d61dcae..573d6c6a 100644 --- a/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go +++ b/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go @@ -28,33 +28,32 @@ type CredentialIssuerInformer interface { type credentialIssuerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, namespace, resyncPeriod, indexers, nil) +func NewCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).List(options) + return client.ConfigV1alpha1().CredentialIssuers().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).Watch(options) + return client.ConfigV1alpha1().CredentialIssuers().Watch(options) }, }, &configv1alpha1.CredentialIssuer{}, @@ -64,7 +63,7 @@ func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace s } func (f *credentialIssuerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *credentialIssuerInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/interface.go b/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/interface.go index 20ded48b..dbafd736 100644 --- a/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/interface.go +++ b/generated/1.17/client/concierge/informers/externalversions/config/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // CredentialIssuers returns a CredentialIssuerInformer. func (v *version) CredentialIssuers() CredentialIssuerInformer { - return &credentialIssuerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &credentialIssuerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/interface.go b/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/interface.go index fcabd538..74657fa7 100644 --- a/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/interface.go +++ b/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // TokenCredentialRequests returns a TokenCredentialRequestInformer. func (v *version) TokenCredentialRequests() TokenCredentialRequestInformer { - return &tokenCredentialRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &tokenCredentialRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go b/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go index 9c82f8ac..02beb1a9 100644 --- a/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.17/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go @@ -28,33 +28,32 @@ type TokenCredentialRequestInformer interface { type tokenCredentialRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, namespace, resyncPeriod, indexers, nil) +func NewTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, indexers, nil) } // NewFilteredTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).List(options) + return client.LoginV1alpha1().TokenCredentialRequests().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).Watch(options) + return client.LoginV1alpha1().TokenCredentialRequests().Watch(options) }, }, &loginv1alpha1.TokenCredentialRequest{}, @@ -64,7 +63,7 @@ func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, names } func (f *tokenCredentialRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *tokenCredentialRequestInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.17/client/concierge/listers/authentication/v1alpha1/expansion_generated.go b/generated/1.17/client/concierge/listers/authentication/v1alpha1/expansion_generated.go index 8e816c71..3669625e 100644 --- a/generated/1.17/client/concierge/listers/authentication/v1alpha1/expansion_generated.go +++ b/generated/1.17/client/concierge/listers/authentication/v1alpha1/expansion_generated.go @@ -9,14 +9,6 @@ package v1alpha1 // JWTAuthenticatorLister. type JWTAuthenticatorListerExpansion interface{} -// JWTAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// JWTAuthenticatorNamespaceLister. -type JWTAuthenticatorNamespaceListerExpansion interface{} - // WebhookAuthenticatorListerExpansion allows custom methods to be added to // WebhookAuthenticatorLister. type WebhookAuthenticatorListerExpansion interface{} - -// WebhookAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// WebhookAuthenticatorNamespaceLister. -type WebhookAuthenticatorNamespaceListerExpansion interface{} diff --git a/generated/1.17/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go b/generated/1.17/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go index 267294f4..c0f439f1 100644 --- a/generated/1.17/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.17/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go @@ -16,8 +16,8 @@ import ( type JWTAuthenticatorLister interface { // List lists all JWTAuthenticators in the indexer. List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // JWTAuthenticators returns an object that can list and get JWTAuthenticators. - JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister + // Get retrieves the JWTAuthenticator from the index for a given name. + Get(name string) (*v1alpha1.JWTAuthenticator, error) JWTAuthenticatorListerExpansion } @@ -39,38 +39,9 @@ func (s *jWTAuthenticatorLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// JWTAuthenticators returns an object that can list and get JWTAuthenticators. -func (s *jWTAuthenticatorLister) JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister { - return jWTAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// JWTAuthenticatorNamespaceLister helps list and get JWTAuthenticators. -type JWTAuthenticatorNamespaceLister interface { - // List lists all JWTAuthenticators in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.JWTAuthenticator, error) - JWTAuthenticatorNamespaceListerExpansion -} - -// jWTAuthenticatorNamespaceLister implements the JWTAuthenticatorNamespaceLister -// interface. -type jWTAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all JWTAuthenticators in the indexer for a given namespace. -func (s jWTAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.JWTAuthenticator)) - }) - return ret, err -} - -// Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. -func (s jWTAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the JWTAuthenticator from the index for a given name. +func (s *jWTAuthenticatorLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.17/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go b/generated/1.17/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go index dcf18bee..7ef139f9 100644 --- a/generated/1.17/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.17/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go @@ -16,8 +16,8 @@ import ( type WebhookAuthenticatorLister interface { // List lists all WebhookAuthenticators in the indexer. List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. - WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister + // Get retrieves the WebhookAuthenticator from the index for a given name. + Get(name string) (*v1alpha1.WebhookAuthenticator, error) WebhookAuthenticatorListerExpansion } @@ -39,38 +39,9 @@ func (s *webhookAuthenticatorLister) List(selector labels.Selector) (ret []*v1al return ret, err } -// WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. -func (s *webhookAuthenticatorLister) WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister { - return webhookAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// WebhookAuthenticatorNamespaceLister helps list and get WebhookAuthenticators. -type WebhookAuthenticatorNamespaceLister interface { - // List lists all WebhookAuthenticators in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.WebhookAuthenticator, error) - WebhookAuthenticatorNamespaceListerExpansion -} - -// webhookAuthenticatorNamespaceLister implements the WebhookAuthenticatorNamespaceLister -// interface. -type webhookAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all WebhookAuthenticators in the indexer for a given namespace. -func (s webhookAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.WebhookAuthenticator)) - }) - return ret, err -} - -// Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. -func (s webhookAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the WebhookAuthenticator from the index for a given name. +func (s *webhookAuthenticatorLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.17/client/concierge/listers/config/v1alpha1/credentialissuer.go b/generated/1.17/client/concierge/listers/config/v1alpha1/credentialissuer.go index abd3de1d..2126976a 100644 --- a/generated/1.17/client/concierge/listers/config/v1alpha1/credentialissuer.go +++ b/generated/1.17/client/concierge/listers/config/v1alpha1/credentialissuer.go @@ -16,8 +16,8 @@ import ( type CredentialIssuerLister interface { // List lists all CredentialIssuers in the indexer. List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // CredentialIssuers returns an object that can list and get CredentialIssuers. - CredentialIssuers(namespace string) CredentialIssuerNamespaceLister + // Get retrieves the CredentialIssuer from the index for a given name. + Get(name string) (*v1alpha1.CredentialIssuer, error) CredentialIssuerListerExpansion } @@ -39,38 +39,9 @@ func (s *credentialIssuerLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// CredentialIssuers returns an object that can list and get CredentialIssuers. -func (s *credentialIssuerLister) CredentialIssuers(namespace string) CredentialIssuerNamespaceLister { - return credentialIssuerNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// CredentialIssuerNamespaceLister helps list and get CredentialIssuers. -type CredentialIssuerNamespaceLister interface { - // List lists all CredentialIssuers in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // Get retrieves the CredentialIssuer from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.CredentialIssuer, error) - CredentialIssuerNamespaceListerExpansion -} - -// credentialIssuerNamespaceLister implements the CredentialIssuerNamespaceLister -// interface. -type credentialIssuerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CredentialIssuers in the indexer for a given namespace. -func (s credentialIssuerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CredentialIssuer)) - }) - return ret, err -} - -// Get retrieves the CredentialIssuer from the indexer for a given namespace and name. -func (s credentialIssuerNamespaceLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the CredentialIssuer from the index for a given name. +func (s *credentialIssuerLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.17/client/concierge/listers/config/v1alpha1/expansion_generated.go b/generated/1.17/client/concierge/listers/config/v1alpha1/expansion_generated.go index e5a0b56a..7d17546c 100644 --- a/generated/1.17/client/concierge/listers/config/v1alpha1/expansion_generated.go +++ b/generated/1.17/client/concierge/listers/config/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // CredentialIssuerListerExpansion allows custom methods to be added to // CredentialIssuerLister. type CredentialIssuerListerExpansion interface{} - -// CredentialIssuerNamespaceListerExpansion allows custom methods to be added to -// CredentialIssuerNamespaceLister. -type CredentialIssuerNamespaceListerExpansion interface{} diff --git a/generated/1.17/client/concierge/listers/login/v1alpha1/expansion_generated.go b/generated/1.17/client/concierge/listers/login/v1alpha1/expansion_generated.go index f61ce6bb..0fcbfa49 100644 --- a/generated/1.17/client/concierge/listers/login/v1alpha1/expansion_generated.go +++ b/generated/1.17/client/concierge/listers/login/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // TokenCredentialRequestListerExpansion allows custom methods to be added to // TokenCredentialRequestLister. type TokenCredentialRequestListerExpansion interface{} - -// TokenCredentialRequestNamespaceListerExpansion allows custom methods to be added to -// TokenCredentialRequestNamespaceLister. -type TokenCredentialRequestNamespaceListerExpansion interface{} diff --git a/generated/1.17/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go b/generated/1.17/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go index 9aaa9bd3..a9c4d5a4 100644 --- a/generated/1.17/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.17/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go @@ -16,8 +16,8 @@ import ( type TokenCredentialRequestLister interface { // List lists all TokenCredentialRequests in the indexer. List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. - TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister + // Get retrieves the TokenCredentialRequest from the index for a given name. + Get(name string) (*v1alpha1.TokenCredentialRequest, error) TokenCredentialRequestListerExpansion } @@ -39,38 +39,9 @@ func (s *tokenCredentialRequestLister) List(selector labels.Selector) (ret []*v1 return ret, err } -// TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. -func (s *tokenCredentialRequestLister) TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister { - return tokenCredentialRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// TokenCredentialRequestNamespaceLister helps list and get TokenCredentialRequests. -type TokenCredentialRequestNamespaceLister interface { - // List lists all TokenCredentialRequests in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.TokenCredentialRequest, error) - TokenCredentialRequestNamespaceListerExpansion -} - -// tokenCredentialRequestNamespaceLister implements the TokenCredentialRequestNamespaceLister -// interface. -type tokenCredentialRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TokenCredentialRequests in the indexer for a given namespace. -func (s tokenCredentialRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.TokenCredentialRequest)) - }) - return ret, err -} - -// Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. -func (s tokenCredentialRequestNamespaceLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the TokenCredentialRequest from the index for a given name. +func (s *tokenCredentialRequestLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go index 3e159148..480b1015 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,6 +57,7 @@ type JWTTokenClaims struct { // signature, existence of claims, etc.) and extract the username and groups from the token. // // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` diff --git a/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go index d12a1f3c..32062949 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,6 +29,7 @@ type WebhookAuthenticatorSpec struct { // WebhookAuthenticator describes the configuration of a webhook authenticator. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` diff --git a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go index f462056d..c0425a79 100644 --- a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,6 +67,7 @@ type CredentialIssuerStrategy struct { // Describes the configuration status of a Pinniped credential issuer. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped type CredentialIssuer struct { diff --git a/generated/1.18/apis/concierge/login/types_token.go b/generated/1.18/apis/concierge/login/types_token.go index a0555f85..17a341b2 100644 --- a/generated/1.18/apis/concierge/login/types_token.go +++ b/generated/1.18/apis/concierge/login/types_token.go @@ -27,7 +27,6 @@ type TokenCredentialRequestStatus struct { } // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. -// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta diff --git a/generated/1.18/apis/concierge/login/v1alpha1/types_token.go b/generated/1.18/apis/concierge/login/v1alpha1/types_token.go index cb5965a2..66b744f3 100644 --- a/generated/1.18/apis/concierge/login/v1alpha1/types_token.go +++ b/generated/1.18/apis/concierge/login/v1alpha1/types_token.go @@ -30,6 +30,7 @@ type TokenCredentialRequestStatus struct { // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go index f88ebf7e..25520da7 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go @@ -22,12 +22,12 @@ type AuthenticationV1alpha1Client struct { restClient rest.Interface } -func (c *AuthenticationV1alpha1Client) JWTAuthenticators(namespace string) JWTAuthenticatorInterface { - return newJWTAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) JWTAuthenticators() JWTAuthenticatorInterface { + return newJWTAuthenticators(c) } -func (c *AuthenticationV1alpha1Client) WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface { - return newWebhookAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) WebhookAuthenticators() WebhookAuthenticatorInterface { + return newWebhookAuthenticators(c) } // NewForConfig creates a new AuthenticationV1alpha1Client for the given config. diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go index fafe5d5d..63ef3a9d 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go @@ -15,12 +15,12 @@ type FakeAuthenticationV1alpha1 struct { *testing.Fake } -func (c *FakeAuthenticationV1alpha1) JWTAuthenticators(namespace string) v1alpha1.JWTAuthenticatorInterface { - return &FakeJWTAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) JWTAuthenticators() v1alpha1.JWTAuthenticatorInterface { + return &FakeJWTAuthenticators{c} } -func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators(namespace string) v1alpha1.WebhookAuthenticatorInterface { - return &FakeWebhookAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators() v1alpha1.WebhookAuthenticatorInterface { + return &FakeWebhookAuthenticators{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go index dfbdc7d9..c9a68df3 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go @@ -20,7 +20,6 @@ import ( // FakeJWTAuthenticators implements JWTAuthenticatorInterface type FakeJWTAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var jwtauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "jwtauthenticators"} @@ -30,8 +29,7 @@ var jwtauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.conci // Get takes name of the jWTAuthenticator, and returns the corresponding jWTAuthenticator object, and an error if there is any. func (c *FakeJWTAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootGetAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeJWTAuthenticators) Get(ctx context.Context, name string, options v1 // List takes label and field selectors, and returns the list of JWTAuthenticators that match those selectors. func (c *FakeJWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JWTAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, c.ns, opts), &v1alpha1.JWTAuthenticatorList{}) - + Invokes(testing.NewRootListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, opts), &v1alpha1.JWTAuthenticatorList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeJWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested jWTAuthenticators. func (c *FakeJWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(jwtauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(jwtauthenticatorsResource, opts)) } // Create takes the representation of a jWTAuthenticator and creates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.CreateOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootCreateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeJWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1 // Update takes the representation of a jWTAuthenticator and updates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeJWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeJWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (*v1alpha1.JWTAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jwtauthenticatorsResource, "status", c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(jwtauthenticatorsResource, "status", jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeJWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticat // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeJWTAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeJWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jwtauthenticatorsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(jwtauthenticatorsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.JWTAuthenticatorList{}) return err @@ -120,8 +112,7 @@ func (c *FakeJWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched jWTAuthenticator. func (c *FakeJWTAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jwtauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(jwtauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go index 83adeb87..d5232f77 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go @@ -20,7 +20,6 @@ import ( // FakeWebhookAuthenticators implements WebhookAuthenticatorInterface type FakeWebhookAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var webhookauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "webhookauthenticators"} @@ -30,8 +29,7 @@ var webhookauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.c // Get takes name of the webhookAuthenticator, and returns the corresponding webhookAuthenticator object, and an error if there is any. func (c *FakeWebhookAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootGetAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeWebhookAuthenticators) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of WebhookAuthenticators that match those selectors. func (c *FakeWebhookAuthenticators) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.WebhookAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, c.ns, opts), &v1alpha1.WebhookAuthenticatorList{}) - + Invokes(testing.NewRootListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, opts), &v1alpha1.WebhookAuthenticatorList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeWebhookAuthenticators) List(ctx context.Context, opts v1.ListOption // Watch returns a watch.Interface that watches the requested webhookAuthenticators. func (c *FakeWebhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(webhookauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(webhookauthenticatorsResource, opts)) } // Create takes the representation of a webhookAuthenticator and creates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Create(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.CreateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootCreateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeWebhookAuthenticators) Create(ctx context.Context, webhookAuthentic // Update takes the representation of a webhookAuthenticator and updates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Update(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeWebhookAuthenticators) Update(ctx context.Context, webhookAuthentic // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeWebhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (*v1alpha1.WebhookAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(webhookauthenticatorsResource, "status", c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(webhookauthenticatorsResource, "status", webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeWebhookAuthenticators) UpdateStatus(ctx context.Context, webhookAut // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeWebhookAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeWebhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(webhookauthenticatorsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(webhookauthenticatorsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.WebhookAuthenticatorList{}) return err @@ -120,8 +112,7 @@ func (c *FakeWebhookAuthenticators) DeleteCollection(ctx context.Context, opts v // Patch applies the patch and returns the patched webhookAuthenticator. func (c *FakeWebhookAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(webhookauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(webhookauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go index 3ad08674..f133c49b 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go @@ -20,7 +20,7 @@ import ( // JWTAuthenticatorsGetter has a method to return a JWTAuthenticatorInterface. // A group's client should implement this interface. type JWTAuthenticatorsGetter interface { - JWTAuthenticators(namespace string) JWTAuthenticatorInterface + JWTAuthenticators() JWTAuthenticatorInterface } // JWTAuthenticatorInterface has methods to work with JWTAuthenticator resources. @@ -40,14 +40,12 @@ type JWTAuthenticatorInterface interface { // jWTAuthenticators implements JWTAuthenticatorInterface type jWTAuthenticators struct { client rest.Interface - ns string } // newJWTAuthenticators returns a JWTAuthenticators -func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jWTAuthenticators { +func newJWTAuthenticators(c *AuthenticationV1alpha1Client) *jWTAuthenticators { return &jWTAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jW func (c *jWTAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *jWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) (resu } result = &v1alpha1.JWTAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *jWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (wat } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *jWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (wat func (c *jWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.CreateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Body(jWTAuthenticator). @@ -113,7 +107,6 @@ func (c *jWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alph func (c *jWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *jWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alph func (c *jWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *jWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator * // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *jWTAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *jWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.Delete timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *jWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.Delete func (c *jWTAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). SubResource(subresources...). diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go index 0efa8b7a..b2caaa36 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go @@ -20,7 +20,7 @@ import ( // WebhookAuthenticatorsGetter has a method to return a WebhookAuthenticatorInterface. // A group's client should implement this interface. type WebhookAuthenticatorsGetter interface { - WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface + WebhookAuthenticators() WebhookAuthenticatorInterface } // WebhookAuthenticatorInterface has methods to work with WebhookAuthenticator resources. @@ -40,14 +40,12 @@ type WebhookAuthenticatorInterface interface { // webhookAuthenticators implements WebhookAuthenticatorInterface type webhookAuthenticators struct { client rest.Interface - ns string } // newWebhookAuthenticators returns a WebhookAuthenticators -func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *webhookAuthenticators { +func newWebhookAuthenticators(c *AuthenticationV1alpha1Client) *webhookAuthenticators { return &webhookAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) func (c *webhookAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *webhookAuthenticators) List(ctx context.Context, opts v1.ListOptions) ( } result = &v1alpha1.WebhookAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *webhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *webhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) func (c *webhookAuthenticators) Create(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.CreateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Body(webhookAuthenticator). @@ -113,7 +107,6 @@ func (c *webhookAuthenticators) Create(ctx context.Context, webhookAuthenticator func (c *webhookAuthenticators) Update(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *webhookAuthenticators) Update(ctx context.Context, webhookAuthenticator func (c *webhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *webhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthent // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *webhookAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *webhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.De timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *webhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.De func (c *webhookAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). SubResource(subresources...). diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go index 1641d31f..99cdfceb 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go @@ -21,8 +21,8 @@ type ConfigV1alpha1Client struct { restClient rest.Interface } -func (c *ConfigV1alpha1Client) CredentialIssuers(namespace string) CredentialIssuerInterface { - return newCredentialIssuers(c, namespace) +func (c *ConfigV1alpha1Client) CredentialIssuers() CredentialIssuerInterface { + return newCredentialIssuers(c) } // NewForConfig creates a new ConfigV1alpha1Client for the given config. diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go index 71d6849b..7fe8c60e 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go @@ -20,7 +20,7 @@ import ( // CredentialIssuersGetter has a method to return a CredentialIssuerInterface. // A group's client should implement this interface. type CredentialIssuersGetter interface { - CredentialIssuers(namespace string) CredentialIssuerInterface + CredentialIssuers() CredentialIssuerInterface } // CredentialIssuerInterface has methods to work with CredentialIssuer resources. @@ -40,14 +40,12 @@ type CredentialIssuerInterface interface { // credentialIssuers implements CredentialIssuerInterface type credentialIssuers struct { client rest.Interface - ns string } // newCredentialIssuers returns a CredentialIssuers -func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credentialIssuers { +func newCredentialIssuers(c *ConfigV1alpha1Client) *credentialIssuers { return &credentialIssuers{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credential func (c *credentialIssuers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *credentialIssuers) List(ctx context.Context, opts v1.ListOptions) (resu } result = &v1alpha1.CredentialIssuerList{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *credentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (wat } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *credentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (wat func (c *credentialIssuers) Create(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.CreateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Post(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Body(credentialIssuer). @@ -113,7 +107,6 @@ func (c *credentialIssuers) Create(ctx context.Context, credentialIssuer *v1alph func (c *credentialIssuers) Update(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *credentialIssuers) Update(ctx context.Context, credentialIssuer *v1alph func (c *credentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *credentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer * // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *credentialIssuers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *credentialIssuers) DeleteCollection(ctx context.Context, opts v1.Delete timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *credentialIssuers) DeleteCollection(ctx context.Context, opts v1.Delete func (c *credentialIssuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("credentialissuers"). Name(name). SubResource(subresources...). diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go index 9651c6fb..01f6ed0b 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go @@ -15,8 +15,8 @@ type FakeConfigV1alpha1 struct { *testing.Fake } -func (c *FakeConfigV1alpha1) CredentialIssuers(namespace string) v1alpha1.CredentialIssuerInterface { - return &FakeCredentialIssuers{c, namespace} +func (c *FakeConfigV1alpha1) CredentialIssuers() v1alpha1.CredentialIssuerInterface { + return &FakeCredentialIssuers{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go index 9ad65afd..2011dc71 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go @@ -20,7 +20,6 @@ import ( // FakeCredentialIssuers implements CredentialIssuerInterface type FakeCredentialIssuers struct { Fake *FakeConfigV1alpha1 - ns string } var credentialissuersResource = schema.GroupVersionResource{Group: "config.concierge.pinniped.dev", Version: "v1alpha1", Resource: "credentialissuers"} @@ -30,8 +29,7 @@ var credentialissuersKind = schema.GroupVersionKind{Group: "config.concierge.pin // Get takes name of the credentialIssuer, and returns the corresponding credentialIssuer object, and an error if there is any. func (c *FakeCredentialIssuers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootGetAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeCredentialIssuers) Get(ctx context.Context, name string, options v1 // List takes label and field selectors, and returns the list of CredentialIssuers that match those selectors. func (c *FakeCredentialIssuers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CredentialIssuerList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(credentialissuersResource, credentialissuersKind, c.ns, opts), &v1alpha1.CredentialIssuerList{}) - + Invokes(testing.NewRootListAction(credentialissuersResource, credentialissuersKind, opts), &v1alpha1.CredentialIssuerList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeCredentialIssuers) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested credentialIssuers. func (c *FakeCredentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(credentialissuersResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(credentialissuersResource, opts)) } // Create takes the representation of a credentialIssuer and creates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Create(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.CreateOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootCreateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeCredentialIssuers) Create(ctx context.Context, credentialIssuer *v1 // Update takes the representation of a credentialIssuer and updates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Update(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeCredentialIssuers) Update(ctx context.Context, credentialIssuer *v1 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCredentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (*v1alpha1.CredentialIssuer, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(credentialissuersResource, "status", c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateSubresourceAction(credentialissuersResource, "status", credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeCredentialIssuers) UpdateStatus(ctx context.Context, credentialIssu // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *FakeCredentialIssuers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootDeleteAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCredentialIssuers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(credentialissuersResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(credentialissuersResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.CredentialIssuerList{}) return err @@ -120,8 +112,7 @@ func (c *FakeCredentialIssuers) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched credentialIssuer. func (c *FakeCredentialIssuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(credentialissuersResource, c.ns, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootPatchSubresourceAction(credentialissuersResource, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go index fdf95a7b..99bee071 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go @@ -15,8 +15,8 @@ type FakeLoginV1alpha1 struct { *testing.Fake } -func (c *FakeLoginV1alpha1) TokenCredentialRequests(namespace string) v1alpha1.TokenCredentialRequestInterface { - return &FakeTokenCredentialRequests{c, namespace} +func (c *FakeLoginV1alpha1) TokenCredentialRequests() v1alpha1.TokenCredentialRequestInterface { + return &FakeTokenCredentialRequests{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go index 71b08bb2..b37b0502 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go @@ -20,7 +20,6 @@ import ( // FakeTokenCredentialRequests implements TokenCredentialRequestInterface type FakeTokenCredentialRequests struct { Fake *FakeLoginV1alpha1 - ns string } var tokencredentialrequestsResource = schema.GroupVersionResource{Group: "login.concierge.pinniped.dev", Version: "v1alpha1", Resource: "tokencredentialrequests"} @@ -30,8 +29,7 @@ var tokencredentialrequestsKind = schema.GroupVersionKind{Group: "login.concierg // Get takes name of the tokenCredentialRequest, and returns the corresponding tokenCredentialRequest object, and an error if there is any. func (c *FakeTokenCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootGetAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeTokenCredentialRequests) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of TokenCredentialRequests that match those selectors. func (c *FakeTokenCredentialRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TokenCredentialRequestList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, c.ns, opts), &v1alpha1.TokenCredentialRequestList{}) - + Invokes(testing.NewRootListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, opts), &v1alpha1.TokenCredentialRequestList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeTokenCredentialRequests) List(ctx context.Context, opts v1.ListOpti // Watch returns a watch.Interface that watches the requested tokenCredentialRequests. func (c *FakeTokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tokencredentialrequestsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(tokencredentialrequestsResource, opts)) } // Create takes the representation of a tokenCredentialRequest and creates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Create(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.CreateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootCreateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeTokenCredentialRequests) Create(ctx context.Context, tokenCredentia // Update takes the representation of a tokenCredentialRequest and updates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Update(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeTokenCredentialRequests) Update(ctx context.Context, tokenCredentia // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeTokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (*v1alpha1.TokenCredentialRequest, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tokencredentialrequestsResource, "status", c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateSubresourceAction(tokencredentialrequestsResource, "status", tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeTokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCre // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *FakeTokenCredentialRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootDeleteAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeTokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tokencredentialrequestsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(tokencredentialrequestsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.TokenCredentialRequestList{}) return err @@ -120,8 +112,7 @@ func (c *FakeTokenCredentialRequests) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched tokenCredentialRequest. func (c *FakeTokenCredentialRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tokencredentialrequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootPatchSubresourceAction(tokencredentialrequestsResource, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go index 1d3c3afa..a1ec8a73 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go @@ -21,8 +21,8 @@ type LoginV1alpha1Client struct { restClient rest.Interface } -func (c *LoginV1alpha1Client) TokenCredentialRequests(namespace string) TokenCredentialRequestInterface { - return newTokenCredentialRequests(c, namespace) +func (c *LoginV1alpha1Client) TokenCredentialRequests() TokenCredentialRequestInterface { + return newTokenCredentialRequests(c) } // NewForConfig creates a new LoginV1alpha1Client for the given config. diff --git a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go index 753a6302..9c24d07c 100644 --- a/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.18/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go @@ -20,7 +20,7 @@ import ( // TokenCredentialRequestsGetter has a method to return a TokenCredentialRequestInterface. // A group's client should implement this interface. type TokenCredentialRequestsGetter interface { - TokenCredentialRequests(namespace string) TokenCredentialRequestInterface + TokenCredentialRequests() TokenCredentialRequestInterface } // TokenCredentialRequestInterface has methods to work with TokenCredentialRequest resources. @@ -40,14 +40,12 @@ type TokenCredentialRequestInterface interface { // tokenCredentialRequests implements TokenCredentialRequestInterface type tokenCredentialRequests struct { client rest.Interface - ns string } // newTokenCredentialRequests returns a TokenCredentialRequests -func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *tokenCredentialRequests { +func newTokenCredentialRequests(c *LoginV1alpha1Client) *tokenCredentialRequests { return &tokenCredentialRequests{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *token func (c *tokenCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *tokenCredentialRequests) List(ctx context.Context, opts v1.ListOptions) } result = &v1alpha1.TokenCredentialRequestList{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *tokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *tokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions func (c *tokenCredentialRequests) Create(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.CreateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Post(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Body(tokenCredentialRequest). @@ -113,7 +107,6 @@ func (c *tokenCredentialRequests) Create(ctx context.Context, tokenCredentialReq func (c *tokenCredentialRequests) Update(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *tokenCredentialRequests) Update(ctx context.Context, tokenCredentialReq func (c *tokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *tokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredent // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *tokenCredentialRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *tokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1. timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *tokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1. func (c *tokenCredentialRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). SubResource(subresources...). diff --git a/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go b/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go index debe7c93..e4c2c2b2 100644 --- a/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go +++ b/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go @@ -30,10 +30,10 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // JWTAuthenticators returns a JWTAuthenticatorInformer. func (v *version) JWTAuthenticators() JWTAuthenticatorInformer { - return &jWTAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &jWTAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // WebhookAuthenticators returns a WebhookAuthenticatorInformer. func (v *version) WebhookAuthenticators() WebhookAuthenticatorInformer { - return &webhookAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &webhookAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go b/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go index 6f25f276..edebd270 100644 --- a/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go @@ -29,33 +29,32 @@ type JWTAuthenticatorInformer interface { type jWTAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).List(context.TODO(), options) + return client.AuthenticationV1alpha1().JWTAuthenticators().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).Watch(context.TODO(), options) + return client.AuthenticationV1alpha1().JWTAuthenticators().Watch(context.TODO(), options) }, }, &authenticationv1alpha1.JWTAuthenticator{}, @@ -65,7 +64,7 @@ func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace s } func (f *jWTAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *jWTAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go b/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go index e7084cd9..69ff65cd 100644 --- a/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.18/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go @@ -29,33 +29,32 @@ type WebhookAuthenticatorInformer interface { type webhookAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).List(context.TODO(), options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).Watch(context.TODO(), options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().Watch(context.TODO(), options) }, }, &authenticationv1alpha1.WebhookAuthenticator{}, @@ -65,7 +64,7 @@ func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespa } func (f *webhookAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *webhookAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go b/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go index 8ff1edd6..6b47a242 100644 --- a/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go +++ b/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go @@ -29,33 +29,32 @@ type CredentialIssuerInformer interface { type credentialIssuerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, namespace, resyncPeriod, indexers, nil) +func NewCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).List(context.TODO(), options) + return client.ConfigV1alpha1().CredentialIssuers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).Watch(context.TODO(), options) + return client.ConfigV1alpha1().CredentialIssuers().Watch(context.TODO(), options) }, }, &configv1alpha1.CredentialIssuer{}, @@ -65,7 +64,7 @@ func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace s } func (f *credentialIssuerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *credentialIssuerInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/interface.go b/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/interface.go index 1b72f8eb..1770d894 100644 --- a/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/interface.go +++ b/generated/1.18/client/concierge/informers/externalversions/config/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // CredentialIssuers returns a CredentialIssuerInformer. func (v *version) CredentialIssuers() CredentialIssuerInformer { - return &credentialIssuerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &credentialIssuerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/interface.go b/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/interface.go index 39b086ee..89a5ec24 100644 --- a/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/interface.go +++ b/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // TokenCredentialRequests returns a TokenCredentialRequestInformer. func (v *version) TokenCredentialRequests() TokenCredentialRequestInformer { - return &tokenCredentialRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &tokenCredentialRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go b/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go index fd91316a..86094e36 100644 --- a/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.18/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go @@ -29,33 +29,32 @@ type TokenCredentialRequestInformer interface { type tokenCredentialRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, namespace, resyncPeriod, indexers, nil) +func NewTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, indexers, nil) } // NewFilteredTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).List(context.TODO(), options) + return client.LoginV1alpha1().TokenCredentialRequests().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).Watch(context.TODO(), options) + return client.LoginV1alpha1().TokenCredentialRequests().Watch(context.TODO(), options) }, }, &loginv1alpha1.TokenCredentialRequest{}, @@ -65,7 +64,7 @@ func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, names } func (f *tokenCredentialRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *tokenCredentialRequestInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.18/client/concierge/listers/authentication/v1alpha1/expansion_generated.go b/generated/1.18/client/concierge/listers/authentication/v1alpha1/expansion_generated.go index 8e816c71..3669625e 100644 --- a/generated/1.18/client/concierge/listers/authentication/v1alpha1/expansion_generated.go +++ b/generated/1.18/client/concierge/listers/authentication/v1alpha1/expansion_generated.go @@ -9,14 +9,6 @@ package v1alpha1 // JWTAuthenticatorLister. type JWTAuthenticatorListerExpansion interface{} -// JWTAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// JWTAuthenticatorNamespaceLister. -type JWTAuthenticatorNamespaceListerExpansion interface{} - // WebhookAuthenticatorListerExpansion allows custom methods to be added to // WebhookAuthenticatorLister. type WebhookAuthenticatorListerExpansion interface{} - -// WebhookAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// WebhookAuthenticatorNamespaceLister. -type WebhookAuthenticatorNamespaceListerExpansion interface{} diff --git a/generated/1.18/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go b/generated/1.18/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go index 62b6f032..0d337d70 100644 --- a/generated/1.18/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.18/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go @@ -16,8 +16,8 @@ import ( type JWTAuthenticatorLister interface { // List lists all JWTAuthenticators in the indexer. List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // JWTAuthenticators returns an object that can list and get JWTAuthenticators. - JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister + // Get retrieves the JWTAuthenticator from the index for a given name. + Get(name string) (*v1alpha1.JWTAuthenticator, error) JWTAuthenticatorListerExpansion } @@ -39,38 +39,9 @@ func (s *jWTAuthenticatorLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// JWTAuthenticators returns an object that can list and get JWTAuthenticators. -func (s *jWTAuthenticatorLister) JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister { - return jWTAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// JWTAuthenticatorNamespaceLister helps list and get JWTAuthenticators. -type JWTAuthenticatorNamespaceLister interface { - // List lists all JWTAuthenticators in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.JWTAuthenticator, error) - JWTAuthenticatorNamespaceListerExpansion -} - -// jWTAuthenticatorNamespaceLister implements the JWTAuthenticatorNamespaceLister -// interface. -type jWTAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all JWTAuthenticators in the indexer for a given namespace. -func (s jWTAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.JWTAuthenticator)) - }) - return ret, err -} - -// Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. -func (s jWTAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the JWTAuthenticator from the index for a given name. +func (s *jWTAuthenticatorLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.18/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go b/generated/1.18/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go index f6a60ff2..722b5c5d 100644 --- a/generated/1.18/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.18/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go @@ -16,8 +16,8 @@ import ( type WebhookAuthenticatorLister interface { // List lists all WebhookAuthenticators in the indexer. List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. - WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister + // Get retrieves the WebhookAuthenticator from the index for a given name. + Get(name string) (*v1alpha1.WebhookAuthenticator, error) WebhookAuthenticatorListerExpansion } @@ -39,38 +39,9 @@ func (s *webhookAuthenticatorLister) List(selector labels.Selector) (ret []*v1al return ret, err } -// WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. -func (s *webhookAuthenticatorLister) WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister { - return webhookAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// WebhookAuthenticatorNamespaceLister helps list and get WebhookAuthenticators. -type WebhookAuthenticatorNamespaceLister interface { - // List lists all WebhookAuthenticators in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.WebhookAuthenticator, error) - WebhookAuthenticatorNamespaceListerExpansion -} - -// webhookAuthenticatorNamespaceLister implements the WebhookAuthenticatorNamespaceLister -// interface. -type webhookAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all WebhookAuthenticators in the indexer for a given namespace. -func (s webhookAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.WebhookAuthenticator)) - }) - return ret, err -} - -// Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. -func (s webhookAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the WebhookAuthenticator from the index for a given name. +func (s *webhookAuthenticatorLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.18/client/concierge/listers/config/v1alpha1/credentialissuer.go b/generated/1.18/client/concierge/listers/config/v1alpha1/credentialissuer.go index ac4745f7..9e2ae3dc 100644 --- a/generated/1.18/client/concierge/listers/config/v1alpha1/credentialissuer.go +++ b/generated/1.18/client/concierge/listers/config/v1alpha1/credentialissuer.go @@ -16,8 +16,8 @@ import ( type CredentialIssuerLister interface { // List lists all CredentialIssuers in the indexer. List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // CredentialIssuers returns an object that can list and get CredentialIssuers. - CredentialIssuers(namespace string) CredentialIssuerNamespaceLister + // Get retrieves the CredentialIssuer from the index for a given name. + Get(name string) (*v1alpha1.CredentialIssuer, error) CredentialIssuerListerExpansion } @@ -39,38 +39,9 @@ func (s *credentialIssuerLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// CredentialIssuers returns an object that can list and get CredentialIssuers. -func (s *credentialIssuerLister) CredentialIssuers(namespace string) CredentialIssuerNamespaceLister { - return credentialIssuerNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// CredentialIssuerNamespaceLister helps list and get CredentialIssuers. -type CredentialIssuerNamespaceLister interface { - // List lists all CredentialIssuers in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // Get retrieves the CredentialIssuer from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.CredentialIssuer, error) - CredentialIssuerNamespaceListerExpansion -} - -// credentialIssuerNamespaceLister implements the CredentialIssuerNamespaceLister -// interface. -type credentialIssuerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CredentialIssuers in the indexer for a given namespace. -func (s credentialIssuerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CredentialIssuer)) - }) - return ret, err -} - -// Get retrieves the CredentialIssuer from the indexer for a given namespace and name. -func (s credentialIssuerNamespaceLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the CredentialIssuer from the index for a given name. +func (s *credentialIssuerLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.18/client/concierge/listers/config/v1alpha1/expansion_generated.go b/generated/1.18/client/concierge/listers/config/v1alpha1/expansion_generated.go index e5a0b56a..7d17546c 100644 --- a/generated/1.18/client/concierge/listers/config/v1alpha1/expansion_generated.go +++ b/generated/1.18/client/concierge/listers/config/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // CredentialIssuerListerExpansion allows custom methods to be added to // CredentialIssuerLister. type CredentialIssuerListerExpansion interface{} - -// CredentialIssuerNamespaceListerExpansion allows custom methods to be added to -// CredentialIssuerNamespaceLister. -type CredentialIssuerNamespaceListerExpansion interface{} diff --git a/generated/1.18/client/concierge/listers/login/v1alpha1/expansion_generated.go b/generated/1.18/client/concierge/listers/login/v1alpha1/expansion_generated.go index f61ce6bb..0fcbfa49 100644 --- a/generated/1.18/client/concierge/listers/login/v1alpha1/expansion_generated.go +++ b/generated/1.18/client/concierge/listers/login/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // TokenCredentialRequestListerExpansion allows custom methods to be added to // TokenCredentialRequestLister. type TokenCredentialRequestListerExpansion interface{} - -// TokenCredentialRequestNamespaceListerExpansion allows custom methods to be added to -// TokenCredentialRequestNamespaceLister. -type TokenCredentialRequestNamespaceListerExpansion interface{} diff --git a/generated/1.18/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go b/generated/1.18/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go index f85c2e93..bb54fac3 100644 --- a/generated/1.18/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.18/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go @@ -16,8 +16,8 @@ import ( type TokenCredentialRequestLister interface { // List lists all TokenCredentialRequests in the indexer. List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. - TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister + // Get retrieves the TokenCredentialRequest from the index for a given name. + Get(name string) (*v1alpha1.TokenCredentialRequest, error) TokenCredentialRequestListerExpansion } @@ -39,38 +39,9 @@ func (s *tokenCredentialRequestLister) List(selector labels.Selector) (ret []*v1 return ret, err } -// TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. -func (s *tokenCredentialRequestLister) TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister { - return tokenCredentialRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// TokenCredentialRequestNamespaceLister helps list and get TokenCredentialRequests. -type TokenCredentialRequestNamespaceLister interface { - // List lists all TokenCredentialRequests in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.TokenCredentialRequest, error) - TokenCredentialRequestNamespaceListerExpansion -} - -// tokenCredentialRequestNamespaceLister implements the TokenCredentialRequestNamespaceLister -// interface. -type tokenCredentialRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TokenCredentialRequests in the indexer for a given namespace. -func (s tokenCredentialRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.TokenCredentialRequest)) - }) - return ret, err -} - -// Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. -func (s tokenCredentialRequestNamespaceLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the TokenCredentialRequest from the index for a given name. +func (s *tokenCredentialRequestLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go index 3e159148..480b1015 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,6 +57,7 @@ type JWTTokenClaims struct { // signature, existence of claims, etc.) and extract the username and groups from the token. // // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` diff --git a/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go index d12a1f3c..32062949 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,6 +29,7 @@ type WebhookAuthenticatorSpec struct { // WebhookAuthenticator describes the configuration of a webhook authenticator. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` diff --git a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go index f462056d..c0425a79 100644 --- a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,6 +67,7 @@ type CredentialIssuerStrategy struct { // Describes the configuration status of a Pinniped credential issuer. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped type CredentialIssuer struct { diff --git a/generated/1.19/apis/concierge/login/types_token.go b/generated/1.19/apis/concierge/login/types_token.go index a0555f85..17a341b2 100644 --- a/generated/1.19/apis/concierge/login/types_token.go +++ b/generated/1.19/apis/concierge/login/types_token.go @@ -27,7 +27,6 @@ type TokenCredentialRequestStatus struct { } // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. -// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta diff --git a/generated/1.19/apis/concierge/login/v1alpha1/types_token.go b/generated/1.19/apis/concierge/login/v1alpha1/types_token.go index cb5965a2..66b744f3 100644 --- a/generated/1.19/apis/concierge/login/v1alpha1/types_token.go +++ b/generated/1.19/apis/concierge/login/v1alpha1/types_token.go @@ -30,6 +30,7 @@ type TokenCredentialRequestStatus struct { // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go index 58968bcc..339901cb 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go @@ -22,12 +22,12 @@ type AuthenticationV1alpha1Client struct { restClient rest.Interface } -func (c *AuthenticationV1alpha1Client) JWTAuthenticators(namespace string) JWTAuthenticatorInterface { - return newJWTAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) JWTAuthenticators() JWTAuthenticatorInterface { + return newJWTAuthenticators(c) } -func (c *AuthenticationV1alpha1Client) WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface { - return newWebhookAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) WebhookAuthenticators() WebhookAuthenticatorInterface { + return newWebhookAuthenticators(c) } // NewForConfig creates a new AuthenticationV1alpha1Client for the given config. diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go index 6de79a36..797586e8 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go @@ -15,12 +15,12 @@ type FakeAuthenticationV1alpha1 struct { *testing.Fake } -func (c *FakeAuthenticationV1alpha1) JWTAuthenticators(namespace string) v1alpha1.JWTAuthenticatorInterface { - return &FakeJWTAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) JWTAuthenticators() v1alpha1.JWTAuthenticatorInterface { + return &FakeJWTAuthenticators{c} } -func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators(namespace string) v1alpha1.WebhookAuthenticatorInterface { - return &FakeWebhookAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators() v1alpha1.WebhookAuthenticatorInterface { + return &FakeWebhookAuthenticators{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go index c2978cc2..98b61d79 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go @@ -20,7 +20,6 @@ import ( // FakeJWTAuthenticators implements JWTAuthenticatorInterface type FakeJWTAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var jwtauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "jwtauthenticators"} @@ -30,8 +29,7 @@ var jwtauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.conci // Get takes name of the jWTAuthenticator, and returns the corresponding jWTAuthenticator object, and an error if there is any. func (c *FakeJWTAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootGetAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeJWTAuthenticators) Get(ctx context.Context, name string, options v1 // List takes label and field selectors, and returns the list of JWTAuthenticators that match those selectors. func (c *FakeJWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JWTAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, c.ns, opts), &v1alpha1.JWTAuthenticatorList{}) - + Invokes(testing.NewRootListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, opts), &v1alpha1.JWTAuthenticatorList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeJWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested jWTAuthenticators. func (c *FakeJWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(jwtauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(jwtauthenticatorsResource, opts)) } // Create takes the representation of a jWTAuthenticator and creates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.CreateOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootCreateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeJWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1 // Update takes the representation of a jWTAuthenticator and updates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeJWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeJWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (*v1alpha1.JWTAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jwtauthenticatorsResource, "status", c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(jwtauthenticatorsResource, "status", jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeJWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticat // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeJWTAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeJWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jwtauthenticatorsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(jwtauthenticatorsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.JWTAuthenticatorList{}) return err @@ -120,8 +112,7 @@ func (c *FakeJWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched jWTAuthenticator. func (c *FakeJWTAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jwtauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(jwtauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go index 0bc22bc8..a5efde66 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go @@ -20,7 +20,6 @@ import ( // FakeWebhookAuthenticators implements WebhookAuthenticatorInterface type FakeWebhookAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var webhookauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "webhookauthenticators"} @@ -30,8 +29,7 @@ var webhookauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.c // Get takes name of the webhookAuthenticator, and returns the corresponding webhookAuthenticator object, and an error if there is any. func (c *FakeWebhookAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootGetAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeWebhookAuthenticators) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of WebhookAuthenticators that match those selectors. func (c *FakeWebhookAuthenticators) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.WebhookAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, c.ns, opts), &v1alpha1.WebhookAuthenticatorList{}) - + Invokes(testing.NewRootListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, opts), &v1alpha1.WebhookAuthenticatorList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeWebhookAuthenticators) List(ctx context.Context, opts v1.ListOption // Watch returns a watch.Interface that watches the requested webhookAuthenticators. func (c *FakeWebhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(webhookauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(webhookauthenticatorsResource, opts)) } // Create takes the representation of a webhookAuthenticator and creates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Create(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.CreateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootCreateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeWebhookAuthenticators) Create(ctx context.Context, webhookAuthentic // Update takes the representation of a webhookAuthenticator and updates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Update(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeWebhookAuthenticators) Update(ctx context.Context, webhookAuthentic // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeWebhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (*v1alpha1.WebhookAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(webhookauthenticatorsResource, "status", c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(webhookauthenticatorsResource, "status", webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeWebhookAuthenticators) UpdateStatus(ctx context.Context, webhookAut // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeWebhookAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeWebhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(webhookauthenticatorsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(webhookauthenticatorsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.WebhookAuthenticatorList{}) return err @@ -120,8 +112,7 @@ func (c *FakeWebhookAuthenticators) DeleteCollection(ctx context.Context, opts v // Patch applies the patch and returns the patched webhookAuthenticator. func (c *FakeWebhookAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(webhookauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(webhookauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go index e540fcaa..f3179f42 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go @@ -20,7 +20,7 @@ import ( // JWTAuthenticatorsGetter has a method to return a JWTAuthenticatorInterface. // A group's client should implement this interface. type JWTAuthenticatorsGetter interface { - JWTAuthenticators(namespace string) JWTAuthenticatorInterface + JWTAuthenticators() JWTAuthenticatorInterface } // JWTAuthenticatorInterface has methods to work with JWTAuthenticator resources. @@ -40,14 +40,12 @@ type JWTAuthenticatorInterface interface { // jWTAuthenticators implements JWTAuthenticatorInterface type jWTAuthenticators struct { client rest.Interface - ns string } // newJWTAuthenticators returns a JWTAuthenticators -func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jWTAuthenticators { +func newJWTAuthenticators(c *AuthenticationV1alpha1Client) *jWTAuthenticators { return &jWTAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jW func (c *jWTAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *jWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) (resu } result = &v1alpha1.JWTAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *jWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (wat } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *jWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (wat func (c *jWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.CreateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Body(jWTAuthenticator). @@ -113,7 +107,6 @@ func (c *jWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alph func (c *jWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *jWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alph func (c *jWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *jWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator * // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *jWTAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *jWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.Delete timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *jWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.Delete func (c *jWTAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). SubResource(subresources...). diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go index 5c5e63a9..97d9851f 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go @@ -20,7 +20,7 @@ import ( // WebhookAuthenticatorsGetter has a method to return a WebhookAuthenticatorInterface. // A group's client should implement this interface. type WebhookAuthenticatorsGetter interface { - WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface + WebhookAuthenticators() WebhookAuthenticatorInterface } // WebhookAuthenticatorInterface has methods to work with WebhookAuthenticator resources. @@ -40,14 +40,12 @@ type WebhookAuthenticatorInterface interface { // webhookAuthenticators implements WebhookAuthenticatorInterface type webhookAuthenticators struct { client rest.Interface - ns string } // newWebhookAuthenticators returns a WebhookAuthenticators -func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *webhookAuthenticators { +func newWebhookAuthenticators(c *AuthenticationV1alpha1Client) *webhookAuthenticators { return &webhookAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) func (c *webhookAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *webhookAuthenticators) List(ctx context.Context, opts v1.ListOptions) ( } result = &v1alpha1.WebhookAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *webhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *webhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) func (c *webhookAuthenticators) Create(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.CreateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Body(webhookAuthenticator). @@ -113,7 +107,6 @@ func (c *webhookAuthenticators) Create(ctx context.Context, webhookAuthenticator func (c *webhookAuthenticators) Update(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *webhookAuthenticators) Update(ctx context.Context, webhookAuthenticator func (c *webhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *webhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthent // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *webhookAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *webhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.De timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *webhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.De func (c *webhookAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). SubResource(subresources...). diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go index 231d473b..341e2dd2 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go @@ -21,8 +21,8 @@ type ConfigV1alpha1Client struct { restClient rest.Interface } -func (c *ConfigV1alpha1Client) CredentialIssuers(namespace string) CredentialIssuerInterface { - return newCredentialIssuers(c, namespace) +func (c *ConfigV1alpha1Client) CredentialIssuers() CredentialIssuerInterface { + return newCredentialIssuers(c) } // NewForConfig creates a new ConfigV1alpha1Client for the given config. diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go index f5d07b99..e6635dec 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go @@ -20,7 +20,7 @@ import ( // CredentialIssuersGetter has a method to return a CredentialIssuerInterface. // A group's client should implement this interface. type CredentialIssuersGetter interface { - CredentialIssuers(namespace string) CredentialIssuerInterface + CredentialIssuers() CredentialIssuerInterface } // CredentialIssuerInterface has methods to work with CredentialIssuer resources. @@ -40,14 +40,12 @@ type CredentialIssuerInterface interface { // credentialIssuers implements CredentialIssuerInterface type credentialIssuers struct { client rest.Interface - ns string } // newCredentialIssuers returns a CredentialIssuers -func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credentialIssuers { +func newCredentialIssuers(c *ConfigV1alpha1Client) *credentialIssuers { return &credentialIssuers{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credential func (c *credentialIssuers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *credentialIssuers) List(ctx context.Context, opts v1.ListOptions) (resu } result = &v1alpha1.CredentialIssuerList{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *credentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (wat } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *credentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (wat func (c *credentialIssuers) Create(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.CreateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Post(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Body(credentialIssuer). @@ -113,7 +107,6 @@ func (c *credentialIssuers) Create(ctx context.Context, credentialIssuer *v1alph func (c *credentialIssuers) Update(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *credentialIssuers) Update(ctx context.Context, credentialIssuer *v1alph func (c *credentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *credentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer * // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *credentialIssuers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *credentialIssuers) DeleteCollection(ctx context.Context, opts v1.Delete timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *credentialIssuers) DeleteCollection(ctx context.Context, opts v1.Delete func (c *credentialIssuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("credentialissuers"). Name(name). SubResource(subresources...). diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go index f0a5da25..f9ed9a94 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go @@ -15,8 +15,8 @@ type FakeConfigV1alpha1 struct { *testing.Fake } -func (c *FakeConfigV1alpha1) CredentialIssuers(namespace string) v1alpha1.CredentialIssuerInterface { - return &FakeCredentialIssuers{c, namespace} +func (c *FakeConfigV1alpha1) CredentialIssuers() v1alpha1.CredentialIssuerInterface { + return &FakeCredentialIssuers{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go index a8e4b569..af1001e2 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go @@ -20,7 +20,6 @@ import ( // FakeCredentialIssuers implements CredentialIssuerInterface type FakeCredentialIssuers struct { Fake *FakeConfigV1alpha1 - ns string } var credentialissuersResource = schema.GroupVersionResource{Group: "config.concierge.pinniped.dev", Version: "v1alpha1", Resource: "credentialissuers"} @@ -30,8 +29,7 @@ var credentialissuersKind = schema.GroupVersionKind{Group: "config.concierge.pin // Get takes name of the credentialIssuer, and returns the corresponding credentialIssuer object, and an error if there is any. func (c *FakeCredentialIssuers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootGetAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeCredentialIssuers) Get(ctx context.Context, name string, options v1 // List takes label and field selectors, and returns the list of CredentialIssuers that match those selectors. func (c *FakeCredentialIssuers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CredentialIssuerList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(credentialissuersResource, credentialissuersKind, c.ns, opts), &v1alpha1.CredentialIssuerList{}) - + Invokes(testing.NewRootListAction(credentialissuersResource, credentialissuersKind, opts), &v1alpha1.CredentialIssuerList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeCredentialIssuers) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested credentialIssuers. func (c *FakeCredentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(credentialissuersResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(credentialissuersResource, opts)) } // Create takes the representation of a credentialIssuer and creates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Create(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.CreateOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootCreateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeCredentialIssuers) Create(ctx context.Context, credentialIssuer *v1 // Update takes the representation of a credentialIssuer and updates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Update(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeCredentialIssuers) Update(ctx context.Context, credentialIssuer *v1 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCredentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (*v1alpha1.CredentialIssuer, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(credentialissuersResource, "status", c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateSubresourceAction(credentialissuersResource, "status", credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeCredentialIssuers) UpdateStatus(ctx context.Context, credentialIssu // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *FakeCredentialIssuers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootDeleteAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCredentialIssuers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(credentialissuersResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(credentialissuersResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.CredentialIssuerList{}) return err @@ -120,8 +112,7 @@ func (c *FakeCredentialIssuers) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched credentialIssuer. func (c *FakeCredentialIssuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(credentialissuersResource, c.ns, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootPatchSubresourceAction(credentialissuersResource, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go index eba22d82..0822c7e7 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go @@ -15,8 +15,8 @@ type FakeLoginV1alpha1 struct { *testing.Fake } -func (c *FakeLoginV1alpha1) TokenCredentialRequests(namespace string) v1alpha1.TokenCredentialRequestInterface { - return &FakeTokenCredentialRequests{c, namespace} +func (c *FakeLoginV1alpha1) TokenCredentialRequests() v1alpha1.TokenCredentialRequestInterface { + return &FakeTokenCredentialRequests{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go index cf089c28..4c85700f 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go @@ -20,7 +20,6 @@ import ( // FakeTokenCredentialRequests implements TokenCredentialRequestInterface type FakeTokenCredentialRequests struct { Fake *FakeLoginV1alpha1 - ns string } var tokencredentialrequestsResource = schema.GroupVersionResource{Group: "login.concierge.pinniped.dev", Version: "v1alpha1", Resource: "tokencredentialrequests"} @@ -30,8 +29,7 @@ var tokencredentialrequestsKind = schema.GroupVersionKind{Group: "login.concierg // Get takes name of the tokenCredentialRequest, and returns the corresponding tokenCredentialRequest object, and an error if there is any. func (c *FakeTokenCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootGetAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeTokenCredentialRequests) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of TokenCredentialRequests that match those selectors. func (c *FakeTokenCredentialRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TokenCredentialRequestList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, c.ns, opts), &v1alpha1.TokenCredentialRequestList{}) - + Invokes(testing.NewRootListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, opts), &v1alpha1.TokenCredentialRequestList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeTokenCredentialRequests) List(ctx context.Context, opts v1.ListOpti // Watch returns a watch.Interface that watches the requested tokenCredentialRequests. func (c *FakeTokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tokencredentialrequestsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(tokencredentialrequestsResource, opts)) } // Create takes the representation of a tokenCredentialRequest and creates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Create(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.CreateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootCreateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeTokenCredentialRequests) Create(ctx context.Context, tokenCredentia // Update takes the representation of a tokenCredentialRequest and updates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Update(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeTokenCredentialRequests) Update(ctx context.Context, tokenCredentia // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeTokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (*v1alpha1.TokenCredentialRequest, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tokencredentialrequestsResource, "status", c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateSubresourceAction(tokencredentialrequestsResource, "status", tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeTokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCre // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *FakeTokenCredentialRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootDeleteAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeTokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tokencredentialrequestsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(tokencredentialrequestsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.TokenCredentialRequestList{}) return err @@ -120,8 +112,7 @@ func (c *FakeTokenCredentialRequests) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched tokenCredentialRequest. func (c *FakeTokenCredentialRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tokencredentialrequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootPatchSubresourceAction(tokencredentialrequestsResource, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go index 619855b8..f8be5dd9 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go @@ -21,8 +21,8 @@ type LoginV1alpha1Client struct { restClient rest.Interface } -func (c *LoginV1alpha1Client) TokenCredentialRequests(namespace string) TokenCredentialRequestInterface { - return newTokenCredentialRequests(c, namespace) +func (c *LoginV1alpha1Client) TokenCredentialRequests() TokenCredentialRequestInterface { + return newTokenCredentialRequests(c) } // NewForConfig creates a new LoginV1alpha1Client for the given config. diff --git a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go index 6b3fc500..7b8b2345 100644 --- a/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.19/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go @@ -20,7 +20,7 @@ import ( // TokenCredentialRequestsGetter has a method to return a TokenCredentialRequestInterface. // A group's client should implement this interface. type TokenCredentialRequestsGetter interface { - TokenCredentialRequests(namespace string) TokenCredentialRequestInterface + TokenCredentialRequests() TokenCredentialRequestInterface } // TokenCredentialRequestInterface has methods to work with TokenCredentialRequest resources. @@ -40,14 +40,12 @@ type TokenCredentialRequestInterface interface { // tokenCredentialRequests implements TokenCredentialRequestInterface type tokenCredentialRequests struct { client rest.Interface - ns string } // newTokenCredentialRequests returns a TokenCredentialRequests -func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *tokenCredentialRequests { +func newTokenCredentialRequests(c *LoginV1alpha1Client) *tokenCredentialRequests { return &tokenCredentialRequests{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *token func (c *tokenCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *tokenCredentialRequests) List(ctx context.Context, opts v1.ListOptions) } result = &v1alpha1.TokenCredentialRequestList{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *tokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *tokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions func (c *tokenCredentialRequests) Create(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.CreateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Post(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Body(tokenCredentialRequest). @@ -113,7 +107,6 @@ func (c *tokenCredentialRequests) Create(ctx context.Context, tokenCredentialReq func (c *tokenCredentialRequests) Update(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *tokenCredentialRequests) Update(ctx context.Context, tokenCredentialReq func (c *tokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *tokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredent // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *tokenCredentialRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *tokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1. timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *tokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1. func (c *tokenCredentialRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). SubResource(subresources...). diff --git a/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go b/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go index 95a59311..9e21cda1 100644 --- a/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go +++ b/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go @@ -30,10 +30,10 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // JWTAuthenticators returns a JWTAuthenticatorInformer. func (v *version) JWTAuthenticators() JWTAuthenticatorInformer { - return &jWTAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &jWTAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // WebhookAuthenticators returns a WebhookAuthenticatorInformer. func (v *version) WebhookAuthenticators() WebhookAuthenticatorInformer { - return &webhookAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &webhookAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go b/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go index 994e1d5d..e791199a 100644 --- a/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go @@ -29,33 +29,32 @@ type JWTAuthenticatorInformer interface { type jWTAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).List(context.TODO(), options) + return client.AuthenticationV1alpha1().JWTAuthenticators().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).Watch(context.TODO(), options) + return client.AuthenticationV1alpha1().JWTAuthenticators().Watch(context.TODO(), options) }, }, &authenticationv1alpha1.JWTAuthenticator{}, @@ -65,7 +64,7 @@ func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace s } func (f *jWTAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *jWTAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go b/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go index 371da069..f2ee67d4 100644 --- a/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.19/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go @@ -29,33 +29,32 @@ type WebhookAuthenticatorInformer interface { type webhookAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).List(context.TODO(), options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).Watch(context.TODO(), options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().Watch(context.TODO(), options) }, }, &authenticationv1alpha1.WebhookAuthenticator{}, @@ -65,7 +64,7 @@ func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespa } func (f *webhookAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *webhookAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go b/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go index a0e06f11..e2565d45 100644 --- a/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go +++ b/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go @@ -29,33 +29,32 @@ type CredentialIssuerInformer interface { type credentialIssuerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, namespace, resyncPeriod, indexers, nil) +func NewCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).List(context.TODO(), options) + return client.ConfigV1alpha1().CredentialIssuers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).Watch(context.TODO(), options) + return client.ConfigV1alpha1().CredentialIssuers().Watch(context.TODO(), options) }, }, &configv1alpha1.CredentialIssuer{}, @@ -65,7 +64,7 @@ func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace s } func (f *credentialIssuerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *credentialIssuerInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/interface.go b/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/interface.go index 01832fe4..25b5c4b3 100644 --- a/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/interface.go +++ b/generated/1.19/client/concierge/informers/externalversions/config/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // CredentialIssuers returns a CredentialIssuerInformer. func (v *version) CredentialIssuers() CredentialIssuerInformer { - return &credentialIssuerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &credentialIssuerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/interface.go b/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/interface.go index 306c37f4..fc3118b8 100644 --- a/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/interface.go +++ b/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // TokenCredentialRequests returns a TokenCredentialRequestInformer. func (v *version) TokenCredentialRequests() TokenCredentialRequestInformer { - return &tokenCredentialRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &tokenCredentialRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go b/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go index 3a7bd729..912b9943 100644 --- a/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.19/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go @@ -29,33 +29,32 @@ type TokenCredentialRequestInformer interface { type tokenCredentialRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, namespace, resyncPeriod, indexers, nil) +func NewTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, indexers, nil) } // NewFilteredTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).List(context.TODO(), options) + return client.LoginV1alpha1().TokenCredentialRequests().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).Watch(context.TODO(), options) + return client.LoginV1alpha1().TokenCredentialRequests().Watch(context.TODO(), options) }, }, &loginv1alpha1.TokenCredentialRequest{}, @@ -65,7 +64,7 @@ func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, names } func (f *tokenCredentialRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *tokenCredentialRequestInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.19/client/concierge/listers/authentication/v1alpha1/expansion_generated.go b/generated/1.19/client/concierge/listers/authentication/v1alpha1/expansion_generated.go index 8e816c71..3669625e 100644 --- a/generated/1.19/client/concierge/listers/authentication/v1alpha1/expansion_generated.go +++ b/generated/1.19/client/concierge/listers/authentication/v1alpha1/expansion_generated.go @@ -9,14 +9,6 @@ package v1alpha1 // JWTAuthenticatorLister. type JWTAuthenticatorListerExpansion interface{} -// JWTAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// JWTAuthenticatorNamespaceLister. -type JWTAuthenticatorNamespaceListerExpansion interface{} - // WebhookAuthenticatorListerExpansion allows custom methods to be added to // WebhookAuthenticatorLister. type WebhookAuthenticatorListerExpansion interface{} - -// WebhookAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// WebhookAuthenticatorNamespaceLister. -type WebhookAuthenticatorNamespaceListerExpansion interface{} diff --git a/generated/1.19/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go b/generated/1.19/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go index 6d0291ed..bd784a70 100644 --- a/generated/1.19/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.19/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go @@ -18,8 +18,9 @@ type JWTAuthenticatorLister interface { // List lists all JWTAuthenticators in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // JWTAuthenticators returns an object that can list and get JWTAuthenticators. - JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister + // Get retrieves the JWTAuthenticator from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.JWTAuthenticator, error) JWTAuthenticatorListerExpansion } @@ -41,41 +42,9 @@ func (s *jWTAuthenticatorLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// JWTAuthenticators returns an object that can list and get JWTAuthenticators. -func (s *jWTAuthenticatorLister) JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister { - return jWTAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// JWTAuthenticatorNamespaceLister helps list and get JWTAuthenticators. -// All objects returned here must be treated as read-only. -type JWTAuthenticatorNamespaceLister interface { - // List lists all JWTAuthenticators in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.JWTAuthenticator, error) - JWTAuthenticatorNamespaceListerExpansion -} - -// jWTAuthenticatorNamespaceLister implements the JWTAuthenticatorNamespaceLister -// interface. -type jWTAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all JWTAuthenticators in the indexer for a given namespace. -func (s jWTAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.JWTAuthenticator)) - }) - return ret, err -} - -// Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. -func (s jWTAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the JWTAuthenticator from the index for a given name. +func (s *jWTAuthenticatorLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.19/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go b/generated/1.19/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go index 23bbb71d..645f363a 100644 --- a/generated/1.19/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.19/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go @@ -18,8 +18,9 @@ type WebhookAuthenticatorLister interface { // List lists all WebhookAuthenticators in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. - WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister + // Get retrieves the WebhookAuthenticator from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.WebhookAuthenticator, error) WebhookAuthenticatorListerExpansion } @@ -41,41 +42,9 @@ func (s *webhookAuthenticatorLister) List(selector labels.Selector) (ret []*v1al return ret, err } -// WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. -func (s *webhookAuthenticatorLister) WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister { - return webhookAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// WebhookAuthenticatorNamespaceLister helps list and get WebhookAuthenticators. -// All objects returned here must be treated as read-only. -type WebhookAuthenticatorNamespaceLister interface { - // List lists all WebhookAuthenticators in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.WebhookAuthenticator, error) - WebhookAuthenticatorNamespaceListerExpansion -} - -// webhookAuthenticatorNamespaceLister implements the WebhookAuthenticatorNamespaceLister -// interface. -type webhookAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all WebhookAuthenticators in the indexer for a given namespace. -func (s webhookAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.WebhookAuthenticator)) - }) - return ret, err -} - -// Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. -func (s webhookAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the WebhookAuthenticator from the index for a given name. +func (s *webhookAuthenticatorLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.19/client/concierge/listers/config/v1alpha1/credentialissuer.go b/generated/1.19/client/concierge/listers/config/v1alpha1/credentialissuer.go index ee1d4ace..91eeb415 100644 --- a/generated/1.19/client/concierge/listers/config/v1alpha1/credentialissuer.go +++ b/generated/1.19/client/concierge/listers/config/v1alpha1/credentialissuer.go @@ -18,8 +18,9 @@ type CredentialIssuerLister interface { // List lists all CredentialIssuers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // CredentialIssuers returns an object that can list and get CredentialIssuers. - CredentialIssuers(namespace string) CredentialIssuerNamespaceLister + // Get retrieves the CredentialIssuer from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.CredentialIssuer, error) CredentialIssuerListerExpansion } @@ -41,41 +42,9 @@ func (s *credentialIssuerLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// CredentialIssuers returns an object that can list and get CredentialIssuers. -func (s *credentialIssuerLister) CredentialIssuers(namespace string) CredentialIssuerNamespaceLister { - return credentialIssuerNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// CredentialIssuerNamespaceLister helps list and get CredentialIssuers. -// All objects returned here must be treated as read-only. -type CredentialIssuerNamespaceLister interface { - // List lists all CredentialIssuers in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // Get retrieves the CredentialIssuer from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.CredentialIssuer, error) - CredentialIssuerNamespaceListerExpansion -} - -// credentialIssuerNamespaceLister implements the CredentialIssuerNamespaceLister -// interface. -type credentialIssuerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CredentialIssuers in the indexer for a given namespace. -func (s credentialIssuerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CredentialIssuer)) - }) - return ret, err -} - -// Get retrieves the CredentialIssuer from the indexer for a given namespace and name. -func (s credentialIssuerNamespaceLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the CredentialIssuer from the index for a given name. +func (s *credentialIssuerLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.19/client/concierge/listers/config/v1alpha1/expansion_generated.go b/generated/1.19/client/concierge/listers/config/v1alpha1/expansion_generated.go index e5a0b56a..7d17546c 100644 --- a/generated/1.19/client/concierge/listers/config/v1alpha1/expansion_generated.go +++ b/generated/1.19/client/concierge/listers/config/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // CredentialIssuerListerExpansion allows custom methods to be added to // CredentialIssuerLister. type CredentialIssuerListerExpansion interface{} - -// CredentialIssuerNamespaceListerExpansion allows custom methods to be added to -// CredentialIssuerNamespaceLister. -type CredentialIssuerNamespaceListerExpansion interface{} diff --git a/generated/1.19/client/concierge/listers/login/v1alpha1/expansion_generated.go b/generated/1.19/client/concierge/listers/login/v1alpha1/expansion_generated.go index f61ce6bb..0fcbfa49 100644 --- a/generated/1.19/client/concierge/listers/login/v1alpha1/expansion_generated.go +++ b/generated/1.19/client/concierge/listers/login/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // TokenCredentialRequestListerExpansion allows custom methods to be added to // TokenCredentialRequestLister. type TokenCredentialRequestListerExpansion interface{} - -// TokenCredentialRequestNamespaceListerExpansion allows custom methods to be added to -// TokenCredentialRequestNamespaceLister. -type TokenCredentialRequestNamespaceListerExpansion interface{} diff --git a/generated/1.19/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go b/generated/1.19/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go index 1abdf5df..71732a09 100644 --- a/generated/1.19/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.19/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go @@ -18,8 +18,9 @@ type TokenCredentialRequestLister interface { // List lists all TokenCredentialRequests in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. - TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister + // Get retrieves the TokenCredentialRequest from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.TokenCredentialRequest, error) TokenCredentialRequestListerExpansion } @@ -41,41 +42,9 @@ func (s *tokenCredentialRequestLister) List(selector labels.Selector) (ret []*v1 return ret, err } -// TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. -func (s *tokenCredentialRequestLister) TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister { - return tokenCredentialRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// TokenCredentialRequestNamespaceLister helps list and get TokenCredentialRequests. -// All objects returned here must be treated as read-only. -type TokenCredentialRequestNamespaceLister interface { - // List lists all TokenCredentialRequests in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.TokenCredentialRequest, error) - TokenCredentialRequestNamespaceListerExpansion -} - -// tokenCredentialRequestNamespaceLister implements the TokenCredentialRequestNamespaceLister -// interface. -type tokenCredentialRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TokenCredentialRequests in the indexer for a given namespace. -func (s tokenCredentialRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.TokenCredentialRequest)) - }) - return ret, err -} - -// Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. -func (s tokenCredentialRequestNamespaceLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the TokenCredentialRequest from the index for a given name. +func (s *tokenCredentialRequestLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go index 3e159148..480b1015 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,6 +57,7 @@ type JWTTokenClaims struct { // signature, existence of claims, etc.) and extract the username and groups from the token. // // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` diff --git a/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go index d12a1f3c..32062949 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,6 +29,7 @@ type WebhookAuthenticatorSpec struct { // WebhookAuthenticator describes the configuration of a webhook authenticator. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` diff --git a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go index f462056d..c0425a79 100644 --- a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,6 +67,7 @@ type CredentialIssuerStrategy struct { // Describes the configuration status of a Pinniped credential issuer. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped type CredentialIssuer struct { diff --git a/generated/1.20/apis/concierge/login/types_token.go b/generated/1.20/apis/concierge/login/types_token.go index a0555f85..17a341b2 100644 --- a/generated/1.20/apis/concierge/login/types_token.go +++ b/generated/1.20/apis/concierge/login/types_token.go @@ -27,7 +27,6 @@ type TokenCredentialRequestStatus struct { } // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. -// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta diff --git a/generated/1.20/apis/concierge/login/v1alpha1/types_token.go b/generated/1.20/apis/concierge/login/v1alpha1/types_token.go index cb5965a2..66b744f3 100644 --- a/generated/1.20/apis/concierge/login/v1alpha1/types_token.go +++ b/generated/1.20/apis/concierge/login/v1alpha1/types_token.go @@ -30,6 +30,7 @@ type TokenCredentialRequestStatus struct { // TokenCredentialRequest submits an IDP-specific credential to Pinniped in exchange for a cluster-specific credential. // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TokenCredentialRequest struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go index aebb889d..a95e231f 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go @@ -22,12 +22,12 @@ type AuthenticationV1alpha1Client struct { restClient rest.Interface } -func (c *AuthenticationV1alpha1Client) JWTAuthenticators(namespace string) JWTAuthenticatorInterface { - return newJWTAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) JWTAuthenticators() JWTAuthenticatorInterface { + return newJWTAuthenticators(c) } -func (c *AuthenticationV1alpha1Client) WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface { - return newWebhookAuthenticators(c, namespace) +func (c *AuthenticationV1alpha1Client) WebhookAuthenticators() WebhookAuthenticatorInterface { + return newWebhookAuthenticators(c) } // NewForConfig creates a new AuthenticationV1alpha1Client for the given config. diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go index 083644f9..0baf5a67 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go @@ -15,12 +15,12 @@ type FakeAuthenticationV1alpha1 struct { *testing.Fake } -func (c *FakeAuthenticationV1alpha1) JWTAuthenticators(namespace string) v1alpha1.JWTAuthenticatorInterface { - return &FakeJWTAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) JWTAuthenticators() v1alpha1.JWTAuthenticatorInterface { + return &FakeJWTAuthenticators{c} } -func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators(namespace string) v1alpha1.WebhookAuthenticatorInterface { - return &FakeWebhookAuthenticators{c, namespace} +func (c *FakeAuthenticationV1alpha1) WebhookAuthenticators() v1alpha1.WebhookAuthenticatorInterface { + return &FakeWebhookAuthenticators{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go index 83549cce..d1e3d727 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_jwtauthenticator.go @@ -20,7 +20,6 @@ import ( // FakeJWTAuthenticators implements JWTAuthenticatorInterface type FakeJWTAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var jwtauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "jwtauthenticators"} @@ -30,8 +29,7 @@ var jwtauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.conci // Get takes name of the jWTAuthenticator, and returns the corresponding jWTAuthenticator object, and an error if there is any. func (c *FakeJWTAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootGetAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeJWTAuthenticators) Get(ctx context.Context, name string, options v1 // List takes label and field selectors, and returns the list of JWTAuthenticators that match those selectors. func (c *FakeJWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JWTAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, c.ns, opts), &v1alpha1.JWTAuthenticatorList{}) - + Invokes(testing.NewRootListAction(jwtauthenticatorsResource, jwtauthenticatorsKind, opts), &v1alpha1.JWTAuthenticatorList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeJWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested jWTAuthenticators. func (c *FakeJWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(jwtauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(jwtauthenticatorsResource, opts)) } // Create takes the representation of a jWTAuthenticator and creates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.CreateOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootCreateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeJWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1 // Update takes the representation of a jWTAuthenticator and updates it. Returns the server's representation of the jWTAuthenticator, and an error, if there is any. func (c *FakeJWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jwtauthenticatorsResource, c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(jwtauthenticatorsResource, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeJWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeJWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (*v1alpha1.JWTAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jwtauthenticatorsResource, "status", c.ns, jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(jwtauthenticatorsResource, "status", jWTAuthenticator), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeJWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticat // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeJWTAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(jwtauthenticatorsResource, c.ns, name), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(jwtauthenticatorsResource, name), &v1alpha1.JWTAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeJWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jwtauthenticatorsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(jwtauthenticatorsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.JWTAuthenticatorList{}) return err @@ -120,8 +112,7 @@ func (c *FakeJWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched jWTAuthenticator. func (c *FakeJWTAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jwtauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(jwtauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.JWTAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go index d70c36f2..fc15c7c4 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/fake/fake_webhookauthenticator.go @@ -20,7 +20,6 @@ import ( // FakeWebhookAuthenticators implements WebhookAuthenticatorInterface type FakeWebhookAuthenticators struct { Fake *FakeAuthenticationV1alpha1 - ns string } var webhookauthenticatorsResource = schema.GroupVersionResource{Group: "authentication.concierge.pinniped.dev", Version: "v1alpha1", Resource: "webhookauthenticators"} @@ -30,8 +29,7 @@ var webhookauthenticatorsKind = schema.GroupVersionKind{Group: "authentication.c // Get takes name of the webhookAuthenticator, and returns the corresponding webhookAuthenticator object, and an error if there is any. func (c *FakeWebhookAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootGetAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeWebhookAuthenticators) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of WebhookAuthenticators that match those selectors. func (c *FakeWebhookAuthenticators) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.WebhookAuthenticatorList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, c.ns, opts), &v1alpha1.WebhookAuthenticatorList{}) - + Invokes(testing.NewRootListAction(webhookauthenticatorsResource, webhookauthenticatorsKind, opts), &v1alpha1.WebhookAuthenticatorList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeWebhookAuthenticators) List(ctx context.Context, opts v1.ListOption // Watch returns a watch.Interface that watches the requested webhookAuthenticators. func (c *FakeWebhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(webhookauthenticatorsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(webhookauthenticatorsResource, opts)) } // Create takes the representation of a webhookAuthenticator and creates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Create(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.CreateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootCreateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeWebhookAuthenticators) Create(ctx context.Context, webhookAuthentic // Update takes the representation of a webhookAuthenticator and updates it. Returns the server's representation of the webhookAuthenticator, and an error, if there is any. func (c *FakeWebhookAuthenticators) Update(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(webhookauthenticatorsResource, c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateAction(webhookauthenticatorsResource, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeWebhookAuthenticators) Update(ctx context.Context, webhookAuthentic // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeWebhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (*v1alpha1.WebhookAuthenticator, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(webhookauthenticatorsResource, "status", c.ns, webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootUpdateSubresourceAction(webhookauthenticatorsResource, "status", webhookAuthenticator), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeWebhookAuthenticators) UpdateStatus(ctx context.Context, webhookAut // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *FakeWebhookAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(webhookauthenticatorsResource, c.ns, name), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootDeleteAction(webhookauthenticatorsResource, name), &v1alpha1.WebhookAuthenticator{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeWebhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(webhookauthenticatorsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(webhookauthenticatorsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.WebhookAuthenticatorList{}) return err @@ -120,8 +112,7 @@ func (c *FakeWebhookAuthenticators) DeleteCollection(ctx context.Context, opts v // Patch applies the patch and returns the patched webhookAuthenticator. func (c *FakeWebhookAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(webhookauthenticatorsResource, c.ns, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) - + Invokes(testing.NewRootPatchSubresourceAction(webhookauthenticatorsResource, name, pt, data, subresources...), &v1alpha1.WebhookAuthenticator{}) if obj == nil { return nil, err } diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go index 59a89749..f8adeb63 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/jwtauthenticator.go @@ -20,7 +20,7 @@ import ( // JWTAuthenticatorsGetter has a method to return a JWTAuthenticatorInterface. // A group's client should implement this interface. type JWTAuthenticatorsGetter interface { - JWTAuthenticators(namespace string) JWTAuthenticatorInterface + JWTAuthenticators() JWTAuthenticatorInterface } // JWTAuthenticatorInterface has methods to work with JWTAuthenticator resources. @@ -40,14 +40,12 @@ type JWTAuthenticatorInterface interface { // jWTAuthenticators implements JWTAuthenticatorInterface type jWTAuthenticators struct { client rest.Interface - ns string } // newJWTAuthenticators returns a JWTAuthenticators -func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jWTAuthenticators { +func newJWTAuthenticators(c *AuthenticationV1alpha1Client) *jWTAuthenticators { return &jWTAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newJWTAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *jW func (c *jWTAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *jWTAuthenticators) List(ctx context.Context, opts v1.ListOptions) (resu } result = &v1alpha1.JWTAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *jWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (wat } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *jWTAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) (wat func (c *jWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.CreateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Body(jWTAuthenticator). @@ -113,7 +107,6 @@ func (c *jWTAuthenticators) Create(ctx context.Context, jWTAuthenticator *v1alph func (c *jWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *jWTAuthenticators) Update(ctx context.Context, jWTAuthenticator *v1alph func (c *jWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator *v1alpha1.JWTAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(jWTAuthenticator.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *jWTAuthenticators) UpdateStatus(ctx context.Context, jWTAuthenticator * // Delete takes name of the jWTAuthenticator and deletes it. Returns an error if one occurs. func (c *jWTAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *jWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.Delete timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("jwtauthenticators"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *jWTAuthenticators) DeleteCollection(ctx context.Context, opts v1.Delete func (c *jWTAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JWTAuthenticator, err error) { result = &v1alpha1.JWTAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("jwtauthenticators"). Name(name). SubResource(subresources...). diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go index 31258e3c..235b582d 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/authentication/v1alpha1/webhookauthenticator.go @@ -20,7 +20,7 @@ import ( // WebhookAuthenticatorsGetter has a method to return a WebhookAuthenticatorInterface. // A group's client should implement this interface. type WebhookAuthenticatorsGetter interface { - WebhookAuthenticators(namespace string) WebhookAuthenticatorInterface + WebhookAuthenticators() WebhookAuthenticatorInterface } // WebhookAuthenticatorInterface has methods to work with WebhookAuthenticator resources. @@ -40,14 +40,12 @@ type WebhookAuthenticatorInterface interface { // webhookAuthenticators implements WebhookAuthenticatorInterface type webhookAuthenticators struct { client rest.Interface - ns string } // newWebhookAuthenticators returns a WebhookAuthenticators -func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) *webhookAuthenticators { +func newWebhookAuthenticators(c *AuthenticationV1alpha1Client) *webhookAuthenticators { return &webhookAuthenticators{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newWebhookAuthenticators(c *AuthenticationV1alpha1Client, namespace string) func (c *webhookAuthenticators) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *webhookAuthenticators) List(ctx context.Context, opts v1.ListOptions) ( } result = &v1alpha1.WebhookAuthenticatorList{} err = c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *webhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *webhookAuthenticators) Watch(ctx context.Context, opts v1.ListOptions) func (c *webhookAuthenticators) Create(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.CreateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Post(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&opts, scheme.ParameterCodec). Body(webhookAuthenticator). @@ -113,7 +107,6 @@ func (c *webhookAuthenticators) Create(ctx context.Context, webhookAuthenticator func (c *webhookAuthenticators) Update(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *webhookAuthenticators) Update(ctx context.Context, webhookAuthenticator func (c *webhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthenticator *v1alpha1.WebhookAuthenticator, opts v1.UpdateOptions) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Put(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(webhookAuthenticator.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *webhookAuthenticators) UpdateStatus(ctx context.Context, webhookAuthent // Delete takes name of the webhookAuthenticator and deletes it. Returns an error if one occurs. func (c *webhookAuthenticators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *webhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.De timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("webhookauthenticators"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *webhookAuthenticators) DeleteCollection(ctx context.Context, opts v1.De func (c *webhookAuthenticators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WebhookAuthenticator, err error) { result = &v1alpha1.WebhookAuthenticator{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("webhookauthenticators"). Name(name). SubResource(subresources...). diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go index e088d0f4..043cf103 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/config_client.go @@ -21,8 +21,8 @@ type ConfigV1alpha1Client struct { restClient rest.Interface } -func (c *ConfigV1alpha1Client) CredentialIssuers(namespace string) CredentialIssuerInterface { - return newCredentialIssuers(c, namespace) +func (c *ConfigV1alpha1Client) CredentialIssuers() CredentialIssuerInterface { + return newCredentialIssuers(c) } // NewForConfig creates a new ConfigV1alpha1Client for the given config. diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go index 31928ec2..6968d05d 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/credentialissuer.go @@ -20,7 +20,7 @@ import ( // CredentialIssuersGetter has a method to return a CredentialIssuerInterface. // A group's client should implement this interface. type CredentialIssuersGetter interface { - CredentialIssuers(namespace string) CredentialIssuerInterface + CredentialIssuers() CredentialIssuerInterface } // CredentialIssuerInterface has methods to work with CredentialIssuer resources. @@ -40,14 +40,12 @@ type CredentialIssuerInterface interface { // credentialIssuers implements CredentialIssuerInterface type credentialIssuers struct { client rest.Interface - ns string } // newCredentialIssuers returns a CredentialIssuers -func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credentialIssuers { +func newCredentialIssuers(c *ConfigV1alpha1Client) *credentialIssuers { return &credentialIssuers{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newCredentialIssuers(c *ConfigV1alpha1Client, namespace string) *credential func (c *credentialIssuers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *credentialIssuers) List(ctx context.Context, opts v1.ListOptions) (resu } result = &v1alpha1.CredentialIssuerList{} err = c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *credentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (wat } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *credentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (wat func (c *credentialIssuers) Create(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.CreateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Post(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&opts, scheme.ParameterCodec). Body(credentialIssuer). @@ -113,7 +107,6 @@ func (c *credentialIssuers) Create(ctx context.Context, credentialIssuer *v1alph func (c *credentialIssuers) Update(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *credentialIssuers) Update(ctx context.Context, credentialIssuer *v1alph func (c *credentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Put(). - Namespace(c.ns). Resource("credentialissuers"). Name(credentialIssuer.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *credentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer * // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *credentialIssuers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *credentialIssuers) DeleteCollection(ctx context.Context, opts v1.Delete timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("credentialissuers"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *credentialIssuers) DeleteCollection(ctx context.Context, opts v1.Delete func (c *credentialIssuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { result = &v1alpha1.CredentialIssuer{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("credentialissuers"). Name(name). SubResource(subresources...). diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go index 9657f832..a0906993 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go @@ -15,8 +15,8 @@ type FakeConfigV1alpha1 struct { *testing.Fake } -func (c *FakeConfigV1alpha1) CredentialIssuers(namespace string) v1alpha1.CredentialIssuerInterface { - return &FakeCredentialIssuers{c, namespace} +func (c *FakeConfigV1alpha1) CredentialIssuers() v1alpha1.CredentialIssuerInterface { + return &FakeCredentialIssuers{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go index 9124a8d5..fe474401 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/config/v1alpha1/fake/fake_credentialissuer.go @@ -20,7 +20,6 @@ import ( // FakeCredentialIssuers implements CredentialIssuerInterface type FakeCredentialIssuers struct { Fake *FakeConfigV1alpha1 - ns string } var credentialissuersResource = schema.GroupVersionResource{Group: "config.concierge.pinniped.dev", Version: "v1alpha1", Resource: "credentialissuers"} @@ -30,8 +29,7 @@ var credentialissuersKind = schema.GroupVersionKind{Group: "config.concierge.pin // Get takes name of the credentialIssuer, and returns the corresponding credentialIssuer object, and an error if there is any. func (c *FakeCredentialIssuers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootGetAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeCredentialIssuers) Get(ctx context.Context, name string, options v1 // List takes label and field selectors, and returns the list of CredentialIssuers that match those selectors. func (c *FakeCredentialIssuers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CredentialIssuerList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(credentialissuersResource, credentialissuersKind, c.ns, opts), &v1alpha1.CredentialIssuerList{}) - + Invokes(testing.NewRootListAction(credentialissuersResource, credentialissuersKind, opts), &v1alpha1.CredentialIssuerList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeCredentialIssuers) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested credentialIssuers. func (c *FakeCredentialIssuers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(credentialissuersResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(credentialissuersResource, opts)) } // Create takes the representation of a credentialIssuer and creates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Create(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.CreateOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootCreateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeCredentialIssuers) Create(ctx context.Context, credentialIssuer *v1 // Update takes the representation of a credentialIssuer and updates it. Returns the server's representation of the credentialIssuer, and an error, if there is any. func (c *FakeCredentialIssuers) Update(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(credentialissuersResource, c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateAction(credentialissuersResource, credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeCredentialIssuers) Update(ctx context.Context, credentialIssuer *v1 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCredentialIssuers) UpdateStatus(ctx context.Context, credentialIssuer *v1alpha1.CredentialIssuer, opts v1.UpdateOptions) (*v1alpha1.CredentialIssuer, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(credentialissuersResource, "status", c.ns, credentialIssuer), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootUpdateSubresourceAction(credentialissuersResource, "status", credentialIssuer), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeCredentialIssuers) UpdateStatus(ctx context.Context, credentialIssu // Delete takes name of the credentialIssuer and deletes it. Returns an error if one occurs. func (c *FakeCredentialIssuers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(credentialissuersResource, c.ns, name), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootDeleteAction(credentialissuersResource, name), &v1alpha1.CredentialIssuer{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCredentialIssuers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(credentialissuersResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(credentialissuersResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.CredentialIssuerList{}) return err @@ -120,8 +112,7 @@ func (c *FakeCredentialIssuers) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched credentialIssuer. func (c *FakeCredentialIssuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CredentialIssuer, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(credentialissuersResource, c.ns, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) - + Invokes(testing.NewRootPatchSubresourceAction(credentialissuersResource, name, pt, data, subresources...), &v1alpha1.CredentialIssuer{}) if obj == nil { return nil, err } diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go index 97167f7a..932df370 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_login_client.go @@ -15,8 +15,8 @@ type FakeLoginV1alpha1 struct { *testing.Fake } -func (c *FakeLoginV1alpha1) TokenCredentialRequests(namespace string) v1alpha1.TokenCredentialRequestInterface { - return &FakeTokenCredentialRequests{c, namespace} +func (c *FakeLoginV1alpha1) TokenCredentialRequests() v1alpha1.TokenCredentialRequestInterface { + return &FakeTokenCredentialRequests{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go index 172a311e..11d8d0ef 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/fake/fake_tokencredentialrequest.go @@ -20,7 +20,6 @@ import ( // FakeTokenCredentialRequests implements TokenCredentialRequestInterface type FakeTokenCredentialRequests struct { Fake *FakeLoginV1alpha1 - ns string } var tokencredentialrequestsResource = schema.GroupVersionResource{Group: "login.concierge.pinniped.dev", Version: "v1alpha1", Resource: "tokencredentialrequests"} @@ -30,8 +29,7 @@ var tokencredentialrequestsKind = schema.GroupVersionKind{Group: "login.concierg // Get takes name of the tokenCredentialRequest, and returns the corresponding tokenCredentialRequest object, and an error if there is any. func (c *FakeTokenCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootGetAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -41,8 +39,7 @@ func (c *FakeTokenCredentialRequests) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of TokenCredentialRequests that match those selectors. func (c *FakeTokenCredentialRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TokenCredentialRequestList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, c.ns, opts), &v1alpha1.TokenCredentialRequestList{}) - + Invokes(testing.NewRootListAction(tokencredentialrequestsResource, tokencredentialrequestsKind, opts), &v1alpha1.TokenCredentialRequestList{}) if obj == nil { return nil, err } @@ -63,15 +60,13 @@ func (c *FakeTokenCredentialRequests) List(ctx context.Context, opts v1.ListOpti // Watch returns a watch.Interface that watches the requested tokenCredentialRequests. func (c *FakeTokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tokencredentialrequestsResource, c.ns, opts)) - + InvokesWatch(testing.NewRootWatchAction(tokencredentialrequestsResource, opts)) } // Create takes the representation of a tokenCredentialRequest and creates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Create(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.CreateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootCreateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -81,8 +76,7 @@ func (c *FakeTokenCredentialRequests) Create(ctx context.Context, tokenCredentia // Update takes the representation of a tokenCredentialRequest and updates it. Returns the server's representation of the tokenCredentialRequest, and an error, if there is any. func (c *FakeTokenCredentialRequests) Update(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tokencredentialrequestsResource, c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateAction(tokencredentialrequestsResource, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -93,8 +87,7 @@ func (c *FakeTokenCredentialRequests) Update(ctx context.Context, tokenCredentia // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeTokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (*v1alpha1.TokenCredentialRequest, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tokencredentialrequestsResource, "status", c.ns, tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootUpdateSubresourceAction(tokencredentialrequestsResource, "status", tokenCredentialRequest), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } @@ -104,14 +97,13 @@ func (c *FakeTokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCre // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *FakeTokenCredentialRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(tokencredentialrequestsResource, c.ns, name), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootDeleteAction(tokencredentialrequestsResource, name), &v1alpha1.TokenCredentialRequest{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeTokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tokencredentialrequestsResource, c.ns, listOpts) + action := testing.NewRootDeleteCollectionAction(tokencredentialrequestsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.TokenCredentialRequestList{}) return err @@ -120,8 +112,7 @@ func (c *FakeTokenCredentialRequests) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched tokenCredentialRequest. func (c *FakeTokenCredentialRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tokencredentialrequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) - + Invokes(testing.NewRootPatchSubresourceAction(tokencredentialrequestsResource, name, pt, data, subresources...), &v1alpha1.TokenCredentialRequest{}) if obj == nil { return nil, err } diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go index 58a82d20..10f6233d 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/login_client.go @@ -21,8 +21,8 @@ type LoginV1alpha1Client struct { restClient rest.Interface } -func (c *LoginV1alpha1Client) TokenCredentialRequests(namespace string) TokenCredentialRequestInterface { - return newTokenCredentialRequests(c, namespace) +func (c *LoginV1alpha1Client) TokenCredentialRequests() TokenCredentialRequestInterface { + return newTokenCredentialRequests(c) } // NewForConfig creates a new LoginV1alpha1Client for the given config. diff --git a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go index 0c9dc794..a06b34dc 100644 --- a/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.20/client/concierge/clientset/versioned/typed/login/v1alpha1/tokencredentialrequest.go @@ -20,7 +20,7 @@ import ( // TokenCredentialRequestsGetter has a method to return a TokenCredentialRequestInterface. // A group's client should implement this interface. type TokenCredentialRequestsGetter interface { - TokenCredentialRequests(namespace string) TokenCredentialRequestInterface + TokenCredentialRequests() TokenCredentialRequestInterface } // TokenCredentialRequestInterface has methods to work with TokenCredentialRequest resources. @@ -40,14 +40,12 @@ type TokenCredentialRequestInterface interface { // tokenCredentialRequests implements TokenCredentialRequestInterface type tokenCredentialRequests struct { client rest.Interface - ns string } // newTokenCredentialRequests returns a TokenCredentialRequests -func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *tokenCredentialRequests { +func newTokenCredentialRequests(c *LoginV1alpha1Client) *tokenCredentialRequests { return &tokenCredentialRequests{ client: c.RESTClient(), - ns: namespace, } } @@ -55,7 +53,6 @@ func newTokenCredentialRequests(c *LoginV1alpha1Client, namespace string) *token func (c *tokenCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -72,7 +69,6 @@ func (c *tokenCredentialRequests) List(ctx context.Context, opts v1.ListOptions) } result = &v1alpha1.TokenCredentialRequestList{} err = c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -89,7 +85,6 @@ func (c *tokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions } opts.Watch = true return c.client.Get(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -100,7 +95,6 @@ func (c *tokenCredentialRequests) Watch(ctx context.Context, opts v1.ListOptions func (c *tokenCredentialRequests) Create(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.CreateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Post(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&opts, scheme.ParameterCodec). Body(tokenCredentialRequest). @@ -113,7 +107,6 @@ func (c *tokenCredentialRequests) Create(ctx context.Context, tokenCredentialReq func (c *tokenCredentialRequests) Update(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). VersionedParams(&opts, scheme.ParameterCodec). @@ -128,7 +121,6 @@ func (c *tokenCredentialRequests) Update(ctx context.Context, tokenCredentialReq func (c *tokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredentialRequest *v1alpha1.TokenCredentialRequest, opts v1.UpdateOptions) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Put(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(tokenCredentialRequest.Name). SubResource("status"). @@ -142,7 +134,6 @@ func (c *tokenCredentialRequests) UpdateStatus(ctx context.Context, tokenCredent // Delete takes name of the tokenCredentialRequest and deletes it. Returns an error if one occurs. func (c *tokenCredentialRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). Body(&opts). @@ -157,7 +148,6 @@ func (c *tokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1. timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). - Namespace(c.ns). Resource("tokencredentialrequests"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). @@ -170,7 +160,6 @@ func (c *tokenCredentialRequests) DeleteCollection(ctx context.Context, opts v1. func (c *tokenCredentialRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TokenCredentialRequest, err error) { result = &v1alpha1.TokenCredentialRequest{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("tokencredentialrequests"). Name(name). SubResource(subresources...). diff --git a/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go b/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go index 295698ac..4cece967 100644 --- a/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go +++ b/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/interface.go @@ -30,10 +30,10 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // JWTAuthenticators returns a JWTAuthenticatorInformer. func (v *version) JWTAuthenticators() JWTAuthenticatorInformer { - return &jWTAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &jWTAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // WebhookAuthenticators returns a WebhookAuthenticatorInformer. func (v *version) WebhookAuthenticators() WebhookAuthenticatorInformer { - return &webhookAuthenticatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &webhookAuthenticatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go b/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go index 4ef4ef55..0fda24d8 100644 --- a/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/jwtauthenticator.go @@ -29,33 +29,32 @@ type JWTAuthenticatorInformer interface { type jWTAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredJWTAuthenticatorInformer constructs a new informer for JWTAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).List(context.TODO(), options) + return client.AuthenticationV1alpha1().JWTAuthenticators().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().JWTAuthenticators(namespace).Watch(context.TODO(), options) + return client.AuthenticationV1alpha1().JWTAuthenticators().Watch(context.TODO(), options) }, }, &authenticationv1alpha1.JWTAuthenticator{}, @@ -65,7 +64,7 @@ func NewFilteredJWTAuthenticatorInformer(client versioned.Interface, namespace s } func (f *jWTAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredJWTAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredJWTAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *jWTAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go b/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go index 0de77025..7eff8b6c 100644 --- a/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.20/client/concierge/informers/externalversions/authentication/v1alpha1/webhookauthenticator.go @@ -29,33 +29,32 @@ type WebhookAuthenticatorInformer interface { type webhookAuthenticatorInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, namespace, resyncPeriod, indexers, nil) +func NewWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, indexers, nil) } // NewFilteredWebhookAuthenticatorInformer constructs a new informer for WebhookAuthenticator type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).List(context.TODO(), options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuthenticationV1alpha1().WebhookAuthenticators(namespace).Watch(context.TODO(), options) + return client.AuthenticationV1alpha1().WebhookAuthenticators().Watch(context.TODO(), options) }, }, &authenticationv1alpha1.WebhookAuthenticator{}, @@ -65,7 +64,7 @@ func NewFilteredWebhookAuthenticatorInformer(client versioned.Interface, namespa } func (f *webhookAuthenticatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredWebhookAuthenticatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredWebhookAuthenticatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *webhookAuthenticatorInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go b/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go index 2a4610b1..fcd74f88 100644 --- a/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go +++ b/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/credentialissuer.go @@ -29,33 +29,32 @@ type CredentialIssuerInformer interface { type credentialIssuerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, namespace, resyncPeriod, indexers, nil) +func NewCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCredentialIssuerInformer constructs a new informer for CredentialIssuer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredCredentialIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).List(context.TODO(), options) + return client.ConfigV1alpha1().CredentialIssuers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ConfigV1alpha1().CredentialIssuers(namespace).Watch(context.TODO(), options) + return client.ConfigV1alpha1().CredentialIssuers().Watch(context.TODO(), options) }, }, &configv1alpha1.CredentialIssuer{}, @@ -65,7 +64,7 @@ func NewFilteredCredentialIssuerInformer(client versioned.Interface, namespace s } func (f *credentialIssuerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCredentialIssuerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredCredentialIssuerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *credentialIssuerInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/interface.go b/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/interface.go index e5d96b0b..c9d0543b 100644 --- a/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/interface.go +++ b/generated/1.20/client/concierge/informers/externalversions/config/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // CredentialIssuers returns a CredentialIssuerInformer. func (v *version) CredentialIssuers() CredentialIssuerInformer { - return &credentialIssuerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &credentialIssuerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/interface.go b/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/interface.go index e882e882..2d4f5a18 100644 --- a/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/interface.go +++ b/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/interface.go @@ -28,5 +28,5 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // TokenCredentialRequests returns a TokenCredentialRequestInformer. func (v *version) TokenCredentialRequests() TokenCredentialRequestInformer { - return &tokenCredentialRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &tokenCredentialRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go b/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go index 6f654c9b..a662145f 100644 --- a/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.20/client/concierge/informers/externalversions/login/v1alpha1/tokencredentialrequest.go @@ -29,33 +29,32 @@ type TokenCredentialRequestInformer interface { type tokenCredentialRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string } // NewTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, namespace, resyncPeriod, indexers, nil) +func NewTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, indexers, nil) } // NewFilteredTokenCredentialRequestInformer constructs a new informer for TokenCredentialRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).List(context.TODO(), options) + return client.LoginV1alpha1().TokenCredentialRequests().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.LoginV1alpha1().TokenCredentialRequests(namespace).Watch(context.TODO(), options) + return client.LoginV1alpha1().TokenCredentialRequests().Watch(context.TODO(), options) }, }, &loginv1alpha1.TokenCredentialRequest{}, @@ -65,7 +64,7 @@ func NewFilteredTokenCredentialRequestInformer(client versioned.Interface, names } func (f *tokenCredentialRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredTokenCredentialRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredTokenCredentialRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *tokenCredentialRequestInformer) Informer() cache.SharedIndexInformer { diff --git a/generated/1.20/client/concierge/listers/authentication/v1alpha1/expansion_generated.go b/generated/1.20/client/concierge/listers/authentication/v1alpha1/expansion_generated.go index 8e816c71..3669625e 100644 --- a/generated/1.20/client/concierge/listers/authentication/v1alpha1/expansion_generated.go +++ b/generated/1.20/client/concierge/listers/authentication/v1alpha1/expansion_generated.go @@ -9,14 +9,6 @@ package v1alpha1 // JWTAuthenticatorLister. type JWTAuthenticatorListerExpansion interface{} -// JWTAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// JWTAuthenticatorNamespaceLister. -type JWTAuthenticatorNamespaceListerExpansion interface{} - // WebhookAuthenticatorListerExpansion allows custom methods to be added to // WebhookAuthenticatorLister. type WebhookAuthenticatorListerExpansion interface{} - -// WebhookAuthenticatorNamespaceListerExpansion allows custom methods to be added to -// WebhookAuthenticatorNamespaceLister. -type WebhookAuthenticatorNamespaceListerExpansion interface{} diff --git a/generated/1.20/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go b/generated/1.20/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go index 53d9b618..c7eaa19f 100644 --- a/generated/1.20/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go +++ b/generated/1.20/client/concierge/listers/authentication/v1alpha1/jwtauthenticator.go @@ -18,8 +18,9 @@ type JWTAuthenticatorLister interface { // List lists all JWTAuthenticators in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // JWTAuthenticators returns an object that can list and get JWTAuthenticators. - JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister + // Get retrieves the JWTAuthenticator from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.JWTAuthenticator, error) JWTAuthenticatorListerExpansion } @@ -41,41 +42,9 @@ func (s *jWTAuthenticatorLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// JWTAuthenticators returns an object that can list and get JWTAuthenticators. -func (s *jWTAuthenticatorLister) JWTAuthenticators(namespace string) JWTAuthenticatorNamespaceLister { - return jWTAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// JWTAuthenticatorNamespaceLister helps list and get JWTAuthenticators. -// All objects returned here must be treated as read-only. -type JWTAuthenticatorNamespaceLister interface { - // List lists all JWTAuthenticators in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) - // Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.JWTAuthenticator, error) - JWTAuthenticatorNamespaceListerExpansion -} - -// jWTAuthenticatorNamespaceLister implements the JWTAuthenticatorNamespaceLister -// interface. -type jWTAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all JWTAuthenticators in the indexer for a given namespace. -func (s jWTAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JWTAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.JWTAuthenticator)) - }) - return ret, err -} - -// Get retrieves the JWTAuthenticator from the indexer for a given namespace and name. -func (s jWTAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the JWTAuthenticator from the index for a given name. +func (s *jWTAuthenticatorLister) Get(name string) (*v1alpha1.JWTAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.20/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go b/generated/1.20/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go index a67f1f6f..4e04f629 100644 --- a/generated/1.20/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go +++ b/generated/1.20/client/concierge/listers/authentication/v1alpha1/webhookauthenticator.go @@ -18,8 +18,9 @@ type WebhookAuthenticatorLister interface { // List lists all WebhookAuthenticators in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. - WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister + // Get retrieves the WebhookAuthenticator from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.WebhookAuthenticator, error) WebhookAuthenticatorListerExpansion } @@ -41,41 +42,9 @@ func (s *webhookAuthenticatorLister) List(selector labels.Selector) (ret []*v1al return ret, err } -// WebhookAuthenticators returns an object that can list and get WebhookAuthenticators. -func (s *webhookAuthenticatorLister) WebhookAuthenticators(namespace string) WebhookAuthenticatorNamespaceLister { - return webhookAuthenticatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// WebhookAuthenticatorNamespaceLister helps list and get WebhookAuthenticators. -// All objects returned here must be treated as read-only. -type WebhookAuthenticatorNamespaceLister interface { - // List lists all WebhookAuthenticators in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) - // Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.WebhookAuthenticator, error) - WebhookAuthenticatorNamespaceListerExpansion -} - -// webhookAuthenticatorNamespaceLister implements the WebhookAuthenticatorNamespaceLister -// interface. -type webhookAuthenticatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all WebhookAuthenticators in the indexer for a given namespace. -func (s webhookAuthenticatorNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.WebhookAuthenticator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.WebhookAuthenticator)) - }) - return ret, err -} - -// Get retrieves the WebhookAuthenticator from the indexer for a given namespace and name. -func (s webhookAuthenticatorNamespaceLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the WebhookAuthenticator from the index for a given name. +func (s *webhookAuthenticatorLister) Get(name string) (*v1alpha1.WebhookAuthenticator, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.20/client/concierge/listers/config/v1alpha1/credentialissuer.go b/generated/1.20/client/concierge/listers/config/v1alpha1/credentialissuer.go index 7eb73871..5c4c981b 100644 --- a/generated/1.20/client/concierge/listers/config/v1alpha1/credentialissuer.go +++ b/generated/1.20/client/concierge/listers/config/v1alpha1/credentialissuer.go @@ -18,8 +18,9 @@ type CredentialIssuerLister interface { // List lists all CredentialIssuers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // CredentialIssuers returns an object that can list and get CredentialIssuers. - CredentialIssuers(namespace string) CredentialIssuerNamespaceLister + // Get retrieves the CredentialIssuer from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.CredentialIssuer, error) CredentialIssuerListerExpansion } @@ -41,41 +42,9 @@ func (s *credentialIssuerLister) List(selector labels.Selector) (ret []*v1alpha1 return ret, err } -// CredentialIssuers returns an object that can list and get CredentialIssuers. -func (s *credentialIssuerLister) CredentialIssuers(namespace string) CredentialIssuerNamespaceLister { - return credentialIssuerNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// CredentialIssuerNamespaceLister helps list and get CredentialIssuers. -// All objects returned here must be treated as read-only. -type CredentialIssuerNamespaceLister interface { - // List lists all CredentialIssuers in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) - // Get retrieves the CredentialIssuer from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.CredentialIssuer, error) - CredentialIssuerNamespaceListerExpansion -} - -// credentialIssuerNamespaceLister implements the CredentialIssuerNamespaceLister -// interface. -type credentialIssuerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CredentialIssuers in the indexer for a given namespace. -func (s credentialIssuerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CredentialIssuer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CredentialIssuer)) - }) - return ret, err -} - -// Get retrieves the CredentialIssuer from the indexer for a given namespace and name. -func (s credentialIssuerNamespaceLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the CredentialIssuer from the index for a given name. +func (s *credentialIssuerLister) Get(name string) (*v1alpha1.CredentialIssuer, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } diff --git a/generated/1.20/client/concierge/listers/config/v1alpha1/expansion_generated.go b/generated/1.20/client/concierge/listers/config/v1alpha1/expansion_generated.go index e5a0b56a..7d17546c 100644 --- a/generated/1.20/client/concierge/listers/config/v1alpha1/expansion_generated.go +++ b/generated/1.20/client/concierge/listers/config/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // CredentialIssuerListerExpansion allows custom methods to be added to // CredentialIssuerLister. type CredentialIssuerListerExpansion interface{} - -// CredentialIssuerNamespaceListerExpansion allows custom methods to be added to -// CredentialIssuerNamespaceLister. -type CredentialIssuerNamespaceListerExpansion interface{} diff --git a/generated/1.20/client/concierge/listers/login/v1alpha1/expansion_generated.go b/generated/1.20/client/concierge/listers/login/v1alpha1/expansion_generated.go index f61ce6bb..0fcbfa49 100644 --- a/generated/1.20/client/concierge/listers/login/v1alpha1/expansion_generated.go +++ b/generated/1.20/client/concierge/listers/login/v1alpha1/expansion_generated.go @@ -8,7 +8,3 @@ package v1alpha1 // TokenCredentialRequestListerExpansion allows custom methods to be added to // TokenCredentialRequestLister. type TokenCredentialRequestListerExpansion interface{} - -// TokenCredentialRequestNamespaceListerExpansion allows custom methods to be added to -// TokenCredentialRequestNamespaceLister. -type TokenCredentialRequestNamespaceListerExpansion interface{} diff --git a/generated/1.20/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go b/generated/1.20/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go index 728042f6..197b295b 100644 --- a/generated/1.20/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go +++ b/generated/1.20/client/concierge/listers/login/v1alpha1/tokencredentialrequest.go @@ -18,8 +18,9 @@ type TokenCredentialRequestLister interface { // List lists all TokenCredentialRequests in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. - TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister + // Get retrieves the TokenCredentialRequest from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.TokenCredentialRequest, error) TokenCredentialRequestListerExpansion } @@ -41,41 +42,9 @@ func (s *tokenCredentialRequestLister) List(selector labels.Selector) (ret []*v1 return ret, err } -// TokenCredentialRequests returns an object that can list and get TokenCredentialRequests. -func (s *tokenCredentialRequestLister) TokenCredentialRequests(namespace string) TokenCredentialRequestNamespaceLister { - return tokenCredentialRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// TokenCredentialRequestNamespaceLister helps list and get TokenCredentialRequests. -// All objects returned here must be treated as read-only. -type TokenCredentialRequestNamespaceLister interface { - // List lists all TokenCredentialRequests in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) - // Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.TokenCredentialRequest, error) - TokenCredentialRequestNamespaceListerExpansion -} - -// tokenCredentialRequestNamespaceLister implements the TokenCredentialRequestNamespaceLister -// interface. -type tokenCredentialRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TokenCredentialRequests in the indexer for a given namespace. -func (s tokenCredentialRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.TokenCredentialRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.TokenCredentialRequest)) - }) - return ret, err -} - -// Get retrieves the TokenCredentialRequest from the indexer for a given namespace and name. -func (s tokenCredentialRequestNamespaceLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) +// Get retrieves the TokenCredentialRequest from the index for a given name. +func (s *tokenCredentialRequestLister) Get(name string) (*v1alpha1.TokenCredentialRequest, error) { + obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } From 89b00e3702b9961e822c897a0f28390ab32cef33 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Tue, 9 Feb 2021 13:59:32 -0500 Subject: [PATCH 03/15] Declare war on namespaces Signed-off-by: Monis Khan --- cmd/pinniped/cmd/cobra_util.go | 6 ++ cmd/pinniped/cmd/kubeconfig.go | 33 ++++---- cmd/pinniped/cmd/kubeconfig_test.go | 39 ++++------ cmd/pinniped/cmd/login_oidc.go | 19 +++-- cmd/pinniped/cmd/login_oidc_test.go | 2 - cmd/pinniped/cmd/login_static.go | 15 ++-- cmd/pinniped/cmd/login_static_test.go | 1 - deploy/concierge/rbac.yaml | 13 ++-- .../jwtcachefiller/jwtcachefiller.go | 2 +- .../jwtcachefiller/jwtcachefiller_test.go | 77 ++++++++----------- .../webhookcachefiller/webhookcachefiller.go | 2 +- .../webhookcachefiller_test.go | 14 ++-- ...eate_or_update_credential_issuer_config.go | 13 ++-- ...or_update_credential_issuer_config_test.go | 33 +++----- .../kube_config_info_publisher.go | 24 +++--- .../kube_config_info_publisher_test.go | 31 +++----- .../kubecertagent/annotater_test.go | 22 ++---- .../controller/kubecertagent/creater_test.go | 40 ++++------ .../controller/kubecertagent/execer_test.go | 35 ++++----- .../controller/kubecertagent/kubecertagent.go | 4 - .../controllermanager/prepare_controllers.go | 27 +++---- internal/kubeclient/kubeclient_test.go | 8 +- pkg/conciergeclient/conciergeclient.go | 18 +---- pkg/conciergeclient/conciergeclient_test.go | 8 +- .../docs/concierge-and-supervisor-demo.md | 3 +- site/content/docs/concierge-only-demo.md | 4 +- test/integration/cli_test.go | 1 - .../concierge_api_serving_certs_test.go | 2 +- test/integration/concierge_client_test.go | 1 - .../concierge_credentialissuerconfig_test.go | 2 +- .../concierge_credentialrequest_test.go | 2 +- test/integration/e2e_test.go | 1 - test/integration/kubeclient_test.go | 4 +- test/library/client.go | 5 +- 34 files changed, 207 insertions(+), 304 deletions(-) diff --git a/cmd/pinniped/cmd/cobra_util.go b/cmd/pinniped/cmd/cobra_util.go index c861dabf..9d5aacd8 100644 --- a/cmd/pinniped/cmd/cobra_util.go +++ b/cmd/pinniped/cmd/cobra_util.go @@ -22,3 +22,9 @@ func mustMarkHidden(cmd *cobra.Command, flags ...string) { } } } + +func mustMarkDeprecated(cmd *cobra.Command, flag, usageMessage string) { + if err := cmd.Flags().MarkDeprecated(flag, usageMessage); err != nil { + panic(err) + } +} diff --git a/cmd/pinniped/cmd/kubeconfig.go b/cmd/pinniped/cmd/kubeconfig.go index 1b108c02..1dd43074 100644 --- a/cmd/pinniped/cmd/kubeconfig.go +++ b/cmd/pinniped/cmd/kubeconfig.go @@ -74,7 +74,6 @@ type getKubeconfigOIDCParams struct { type getKubeconfigConciergeParams struct { disabled bool - namespace string authenticatorName string authenticatorType string apiGroupSuffix string @@ -91,13 +90,14 @@ type getKubeconfigParams struct { func kubeconfigCommand(deps kubeconfigDeps) *cobra.Command { var ( - cmd = cobra.Command{ + cmd = &cobra.Command{ Args: cobra.NoArgs, Use: "kubeconfig", Short: "Generate a Pinniped-based kubeconfig for a cluster", SilenceUsage: true, } - flags getKubeconfigParams + flags getKubeconfigParams + namespace string // unused now ) f := cmd.Flags() @@ -105,7 +105,7 @@ func kubeconfigCommand(deps kubeconfigDeps) *cobra.Command { f.StringVar(&flags.staticTokenEnvName, "static-token-env", "", "Instead of doing an OIDC-based login, read a static token from the environment") f.BoolVar(&flags.concierge.disabled, "no-concierge", false, "Generate a configuration which does not use the concierge, but sends the credential to the cluster directly") - f.StringVar(&flags.concierge.namespace, "concierge-namespace", "pinniped-concierge", "Namespace in which the concierge was installed") + f.StringVar(&namespace, "concierge-namespace", "pinniped-concierge", "Namespace in which the concierge was installed") f.StringVar(&flags.concierge.authenticatorType, "concierge-authenticator-type", "", "Concierge authenticator type (e.g., 'webhook', 'jwt') (default: autodiscover)") f.StringVar(&flags.concierge.authenticatorName, "concierge-authenticator-name", "", "Concierge authenticator name (default: autodiscover)") f.StringVar(&flags.concierge.apiGroupSuffix, "concierge-api-group-suffix", "pinniped.dev", "Concierge API group suffix") @@ -122,10 +122,13 @@ func kubeconfigCommand(deps kubeconfigDeps) *cobra.Command { f.StringVar(&flags.kubeconfigPath, "kubeconfig", os.Getenv("KUBECONFIG"), "Path to kubeconfig file") f.StringVar(&flags.kubeconfigContextOverride, "kubeconfig-context", "", "Kubeconfig context name (default: current active context)") - mustMarkHidden(&cmd, "oidc-debug-session-cache") + mustMarkHidden(cmd, "oidc-debug-session-cache") + + mustMarkDeprecated(cmd, "concierge-namespace", "not needed anymore") + mustMarkHidden(cmd, "concierge-namespace") cmd.RunE = func(cmd *cobra.Command, args []string) error { return runGetKubeconfig(cmd.OutOrStdout(), deps, flags) } - return &cmd + return cmd } //nolint:funlen @@ -170,7 +173,6 @@ func runGetKubeconfig(out io.Writer, deps kubeconfigDeps, flags getKubeconfigPar if !flags.concierge.disabled { authenticator, err := lookupAuthenticator( clientset, - flags.concierge.namespace, flags.concierge.authenticatorType, flags.concierge.authenticatorName, ) @@ -260,7 +262,7 @@ func configureConcierge(authenticator metav1.Object, flags *getKubeconfigParams, if *oidcCABundle == "" && auth.Spec.TLS != nil && auth.Spec.TLS.CertificateAuthorityData != "" { decoded, err := base64.StdEncoding.DecodeString(auth.Spec.TLS.CertificateAuthorityData) if err != nil { - return fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but JWTAuthenticator %s/%s has invalid spec.tls.certificateAuthorityData: %w", auth.Namespace, auth.Name, err) + return fmt.Errorf("tried to autodiscover --oidc-ca-bundle, but JWTAuthenticator %s has invalid spec.tls.certificateAuthorityData: %w", auth.Name, err) } *oidcCABundle = string(decoded) } @@ -270,7 +272,6 @@ func configureConcierge(authenticator metav1.Object, flags *getKubeconfigParams, execConfig.Args = append(execConfig.Args, "--enable-concierge", "--concierge-api-group-suffix="+flags.concierge.apiGroupSuffix, - "--concierge-namespace="+flags.concierge.namespace, "--concierge-authenticator-name="+flags.concierge.authenticatorName, "--concierge-authenticator-type="+flags.concierge.authenticatorType, "--concierge-endpoint="+v1Cluster.Server, @@ -306,7 +307,7 @@ func newExecKubeconfig(cluster *clientcmdapi.Cluster, execConfig *clientcmdapi.E } } -func lookupAuthenticator(clientset conciergeclientset.Interface, namespace, authType, authName string) (metav1.Object, error) { +func lookupAuthenticator(clientset conciergeclientset.Interface, authType, authName string) (metav1.Object, error) { ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*20) defer cancelFunc() @@ -314,9 +315,9 @@ func lookupAuthenticator(clientset conciergeclientset.Interface, namespace, auth if authName != "" && authType != "" { switch strings.ToLower(authType) { case "webhook": - return clientset.AuthenticationV1alpha1().WebhookAuthenticators(namespace).Get(ctx, authName, metav1.GetOptions{}) + return clientset.AuthenticationV1alpha1().WebhookAuthenticators().Get(ctx, authName, metav1.GetOptions{}) case "jwt": - return clientset.AuthenticationV1alpha1().JWTAuthenticators(namespace).Get(ctx, authName, metav1.GetOptions{}) + return clientset.AuthenticationV1alpha1().JWTAuthenticators().Get(ctx, authName, metav1.GetOptions{}) default: return nil, fmt.Errorf(`invalid authenticator type %q, supported values are "webhook" and "jwt"`, authType) } @@ -324,11 +325,11 @@ func lookupAuthenticator(clientset conciergeclientset.Interface, namespace, auth // Otherwise list all the available authenticators and hope there's just a single one. - jwtAuths, err := clientset.AuthenticationV1alpha1().JWTAuthenticators(namespace).List(ctx, metav1.ListOptions{}) + jwtAuths, err := clientset.AuthenticationV1alpha1().JWTAuthenticators().List(ctx, metav1.ListOptions{}) if err != nil { return nil, fmt.Errorf("failed to list JWTAuthenticator objects for autodiscovery: %w", err) } - webhooks, err := clientset.AuthenticationV1alpha1().WebhookAuthenticators(namespace).List(ctx, metav1.ListOptions{}) + webhooks, err := clientset.AuthenticationV1alpha1().WebhookAuthenticators().List(ctx, metav1.ListOptions{}) if err != nil { return nil, fmt.Errorf("failed to list WebhookAuthenticator objects for autodiscovery: %w", err) } @@ -341,10 +342,10 @@ func lookupAuthenticator(clientset conciergeclientset.Interface, namespace, auth results = append(results, &webhooks.Items[i]) } if len(results) == 0 { - return nil, fmt.Errorf("no authenticators were found in namespace %q (try setting --concierge-namespace)", namespace) + return nil, fmt.Errorf("no authenticators were found") } if len(results) > 1 { - return nil, fmt.Errorf("multiple authenticators were found in namespace %q, so the --concierge-authenticator-type/--concierge-authenticator-name flags must be specified", namespace) + return nil, fmt.Errorf("multiple authenticators were found, so the --concierge-authenticator-type/--concierge-authenticator-name flags must be specified") } return results[0], nil } diff --git a/cmd/pinniped/cmd/kubeconfig_test.go b/cmd/pinniped/cmd/kubeconfig_test.go index a1ac8c84..6bb4c519 100644 --- a/cmd/pinniped/cmd/kubeconfig_test.go +++ b/cmd/pinniped/cmd/kubeconfig_test.go @@ -61,7 +61,6 @@ func TestGetKubeconfig(t *testing.T) { --concierge-api-group-suffix string Concierge API group suffix (default "pinniped.dev") --concierge-authenticator-name string Concierge authenticator name (default: autodiscover) --concierge-authenticator-type string Concierge authenticator type (e.g., 'webhook', 'jwt') (default: autodiscover) - --concierge-namespace string Namespace in which the concierge was installed (default "pinniped-concierge") -h, --help help for kubeconfig --kubeconfig string Path to kubeconfig file --kubeconfig-context string Kubeconfig context name (default: current active context) @@ -210,34 +209,32 @@ func TestGetKubeconfig(t *testing.T) { }, wantError: true, wantStderr: here.Doc(` - Error: no authenticators were found in namespace "pinniped-concierge" (try setting --concierge-namespace) + Error: no authenticators were found `), }, { name: "fail to autodetect authenticator, multiple found", args: []string{ "--kubeconfig", "./testdata/kubeconfig.yaml", - "--concierge-namespace", "test-namespace", }, conciergeObjects: []runtime.Object{ - &conciergev1alpha1.JWTAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-1", Namespace: "test-namespace"}}, - &conciergev1alpha1.JWTAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-2", Namespace: "test-namespace"}}, - &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-3", Namespace: "test-namespace"}}, - &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-4", Namespace: "test-namespace"}}, + &conciergev1alpha1.JWTAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-1"}}, + &conciergev1alpha1.JWTAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-2"}}, + &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-3"}}, + &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator-4"}}, }, wantError: true, wantStderr: here.Doc(` - Error: multiple authenticators were found in namespace "test-namespace", so the --concierge-authenticator-type/--concierge-authenticator-name flags must be specified + Error: multiple authenticators were found, so the --concierge-authenticator-type/--concierge-authenticator-name flags must be specified `), }, { name: "autodetect webhook authenticator, missing --oidc-issuer", args: []string{ "--kubeconfig", "./testdata/kubeconfig.yaml", - "--concierge-namespace", "test-namespace", }, conciergeObjects: []runtime.Object{ - &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator", Namespace: "test-namespace"}}, + &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator"}}, }, wantError: true, wantStderr: here.Doc(` @@ -248,11 +245,10 @@ func TestGetKubeconfig(t *testing.T) { name: "autodetect JWT authenticator, invalid TLS bundle", args: []string{ "--kubeconfig", "./testdata/kubeconfig.yaml", - "--concierge-namespace", "test-namespace", }, conciergeObjects: []runtime.Object{ &conciergev1alpha1.JWTAuthenticator{ - ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator", Namespace: "test-namespace"}, + ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator"}, Spec: conciergev1alpha1.JWTAuthenticatorSpec{ TLS: &conciergev1alpha1.TLSSpec{ CertificateAuthorityData: "invalid-base64", @@ -262,19 +258,18 @@ func TestGetKubeconfig(t *testing.T) { }, wantError: true, wantStderr: here.Doc(` - Error: tried to autodiscover --oidc-ca-bundle, but JWTAuthenticator test-namespace/test-authenticator has invalid spec.tls.certificateAuthorityData: illegal base64 data at input byte 7 + Error: tried to autodiscover --oidc-ca-bundle, but JWTAuthenticator test-authenticator has invalid spec.tls.certificateAuthorityData: illegal base64 data at input byte 7 `), }, { name: "invalid static token flags", args: []string{ "--kubeconfig", "./testdata/kubeconfig.yaml", - "--concierge-namespace", "test-namespace", "--static-token", "test-token", "--static-token-env", "TEST_TOKEN", }, conciergeObjects: []runtime.Object{ - &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator", Namespace: "test-namespace"}}, + &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator"}}, }, wantError: true, wantStderr: here.Doc(` @@ -295,11 +290,10 @@ func TestGetKubeconfig(t *testing.T) { name: "valid static token", args: []string{ "--kubeconfig", "./testdata/kubeconfig.yaml", - "--concierge-namespace", "test-namespace", "--static-token", "test-token", }, conciergeObjects: []runtime.Object{ - &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator", Namespace: "test-namespace"}}, + &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator"}}, }, wantStdout: here.Doc(` apiVersion: v1 @@ -326,7 +320,6 @@ func TestGetKubeconfig(t *testing.T) { - static - --enable-concierge - --concierge-api-group-suffix=pinniped.dev - - --concierge-namespace=test-namespace - --concierge-authenticator-name=test-authenticator - --concierge-authenticator-type=webhook - --concierge-endpoint=https://fake-server-url-value @@ -341,11 +334,10 @@ func TestGetKubeconfig(t *testing.T) { name: "valid static token from env var", args: []string{ "--kubeconfig", "./testdata/kubeconfig.yaml", - "--concierge-namespace", "test-namespace", "--static-token-env", "TEST_TOKEN", }, conciergeObjects: []runtime.Object{ - &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator", Namespace: "test-namespace"}}, + &conciergev1alpha1.WebhookAuthenticator{ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator"}}, }, wantStdout: here.Doc(` apiVersion: v1 @@ -372,7 +364,6 @@ func TestGetKubeconfig(t *testing.T) { - static - --enable-concierge - --concierge-api-group-suffix=pinniped.dev - - --concierge-namespace=test-namespace - --concierge-authenticator-name=test-authenticator - --concierge-authenticator-type=webhook - --concierge-endpoint=https://fake-server-url-value @@ -390,7 +381,7 @@ func TestGetKubeconfig(t *testing.T) { }, conciergeObjects: []runtime.Object{ &conciergev1alpha1.JWTAuthenticator{ - ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator", Namespace: "pinniped-concierge"}, + ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator"}, Spec: conciergev1alpha1.JWTAuthenticatorSpec{ Issuer: "https://example.com/issuer", Audience: "test-audience", @@ -425,7 +416,6 @@ func TestGetKubeconfig(t *testing.T) { - oidc - --enable-concierge - --concierge-api-group-suffix=pinniped.dev - - --concierge-namespace=pinniped-concierge - --concierge-authenticator-name=test-authenticator - --concierge-authenticator-type=jwt - --concierge-endpoint=https://fake-server-url-value @@ -457,7 +447,7 @@ func TestGetKubeconfig(t *testing.T) { }, conciergeObjects: []runtime.Object{ &conciergev1alpha1.WebhookAuthenticator{ - ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator", Namespace: "pinniped-concierge"}, + ObjectMeta: metav1.ObjectMeta{Name: "test-authenticator"}, }, }, wantStdout: here.Docf(` @@ -485,7 +475,6 @@ func TestGetKubeconfig(t *testing.T) { - oidc - --enable-concierge - --concierge-api-group-suffix=tuna.io - - --concierge-namespace=pinniped-concierge - --concierge-authenticator-name=test-authenticator - --concierge-authenticator-type=webhook - --concierge-endpoint=https://fake-server-url-value diff --git a/cmd/pinniped/cmd/login_oidc.go b/cmd/pinniped/cmd/login_oidc.go index 7b5f53f3..07cb3560 100644 --- a/cmd/pinniped/cmd/login_oidc.go +++ b/cmd/pinniped/cmd/login_oidc.go @@ -59,7 +59,6 @@ type oidcLoginFlags struct { debugSessionCache bool requestAudience string conciergeEnabled bool - conciergeNamespace string conciergeAuthenticatorType string conciergeAuthenticatorName string conciergeEndpoint string @@ -69,13 +68,14 @@ type oidcLoginFlags struct { func oidcLoginCommand(deps oidcLoginCommandDeps) *cobra.Command { var ( - cmd = cobra.Command{ + cmd = &cobra.Command{ Args: cobra.NoArgs, Use: "oidc --issuer ISSUER", Short: "Login using an OpenID Connect provider", SilenceUsage: true, } - flags oidcLoginFlags + flags oidcLoginFlags + conciergeNamespace string // unused now ) cmd.Flags().StringVar(&flags.issuer, "issuer", "", "OpenID Connect issuer URL") cmd.Flags().StringVar(&flags.clientID, "client-id", "pinniped-cli", "OpenID Connect client ID") @@ -88,17 +88,21 @@ func oidcLoginCommand(deps oidcLoginCommandDeps) *cobra.Command { cmd.Flags().BoolVar(&flags.debugSessionCache, "debug-session-cache", false, "Print debug logs related to the session cache") cmd.Flags().StringVar(&flags.requestAudience, "request-audience", "", "Request a token with an alternate audience using RFC8693 token exchange") cmd.Flags().BoolVar(&flags.conciergeEnabled, "enable-concierge", false, "Exchange the OIDC ID token with the Pinniped concierge during login") - cmd.Flags().StringVar(&flags.conciergeNamespace, "concierge-namespace", "pinniped-concierge", "Namespace in which the concierge was installed") + cmd.Flags().StringVar(&conciergeNamespace, "concierge-namespace", "pinniped-concierge", "Namespace in which the concierge was installed") cmd.Flags().StringVar(&flags.conciergeAuthenticatorType, "concierge-authenticator-type", "", "Concierge authenticator type (e.g., 'webhook', 'jwt')") cmd.Flags().StringVar(&flags.conciergeAuthenticatorName, "concierge-authenticator-name", "", "Concierge authenticator name") cmd.Flags().StringVar(&flags.conciergeEndpoint, "concierge-endpoint", "", "API base for the Pinniped concierge endpoint") cmd.Flags().StringVar(&flags.conciergeCABundle, "concierge-ca-bundle-data", "", "CA bundle to use when connecting to the concierge") cmd.Flags().StringVar(&flags.conciergeAPIGroupSuffix, "concierge-api-group-suffix", "pinniped.dev", "Concierge API group suffix") - mustMarkHidden(&cmd, "debug-session-cache") - mustMarkRequired(&cmd, "issuer") + mustMarkHidden(cmd, "debug-session-cache") + mustMarkRequired(cmd, "issuer") cmd.RunE = func(cmd *cobra.Command, args []string) error { return runOIDCLogin(cmd, deps, flags) } - return &cmd + + mustMarkDeprecated(cmd, "concierge-namespace", "not needed anymore") + mustMarkHidden(cmd, "concierge-namespace") + + return cmd } func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLoginFlags) error { @@ -133,7 +137,6 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin if flags.conciergeEnabled { var err error concierge, err = conciergeclient.New( - conciergeclient.WithNamespace(flags.conciergeNamespace), conciergeclient.WithEndpoint(flags.conciergeEndpoint), conciergeclient.WithBase64CABundle(flags.conciergeCABundle), conciergeclient.WithAuthenticator(flags.conciergeAuthenticatorType, flags.conciergeAuthenticatorName), diff --git a/cmd/pinniped/cmd/login_oidc_test.go b/cmd/pinniped/cmd/login_oidc_test.go index 822b9f82..9a30de4a 100644 --- a/cmd/pinniped/cmd/login_oidc_test.go +++ b/cmd/pinniped/cmd/login_oidc_test.go @@ -65,7 +65,6 @@ func TestLoginOIDCCommand(t *testing.T) { --concierge-authenticator-type string Concierge authenticator type (e.g., 'webhook', 'jwt') --concierge-ca-bundle-data string CA bundle to use when connecting to the concierge --concierge-endpoint string API base for the Pinniped concierge endpoint - --concierge-namespace string Namespace in which the concierge was installed (default "pinniped-concierge") --enable-concierge Exchange the OIDC ID token with the Pinniped concierge during login -h, --help help for oidc --issuer string OpenID Connect issuer URL @@ -186,7 +185,6 @@ func TestLoginOIDCCommand(t *testing.T) { "--ca-bundle-data", base64.StdEncoding.EncodeToString(testCA.Bundle()), "--ca-bundle", testCABundlePath, "--enable-concierge", - "--concierge-namespace", "test-namespace", "--concierge-authenticator-type", "webhook", "--concierge-authenticator-name", "test-authenticator", "--concierge-endpoint", "https://127.0.0.1:1234/", diff --git a/cmd/pinniped/cmd/login_static.go b/cmd/pinniped/cmd/login_static.go index 52fcf095..863afc28 100644 --- a/cmd/pinniped/cmd/login_static.go +++ b/cmd/pinniped/cmd/login_static.go @@ -41,7 +41,6 @@ type staticLoginParams struct { staticToken string staticTokenEnvName string conciergeEnabled bool - conciergeNamespace string conciergeAuthenticatorType string conciergeAuthenticatorName string conciergeEndpoint string @@ -51,25 +50,30 @@ type staticLoginParams struct { func staticLoginCommand(deps staticLoginDeps) *cobra.Command { var ( - cmd = cobra.Command{ + cmd = &cobra.Command{ Args: cobra.NoArgs, Use: "static [--token TOKEN] [--token-env TOKEN_NAME]", Short: "Login using a static token", SilenceUsage: true, } - flags staticLoginParams + flags staticLoginParams + conciergeNamespace string // unused now ) cmd.Flags().StringVar(&flags.staticToken, "token", "", "Static token to present during login") cmd.Flags().StringVar(&flags.staticTokenEnvName, "token-env", "", "Environment variable containing a static token") cmd.Flags().BoolVar(&flags.conciergeEnabled, "enable-concierge", false, "Exchange the token with the Pinniped concierge during login") - cmd.Flags().StringVar(&flags.conciergeNamespace, "concierge-namespace", "pinniped-concierge", "Namespace in which the concierge was installed") + cmd.Flags().StringVar(&conciergeNamespace, "concierge-namespace", "pinniped-concierge", "Namespace in which the concierge was installed") cmd.Flags().StringVar(&flags.conciergeAuthenticatorType, "concierge-authenticator-type", "", "Concierge authenticator type (e.g., 'webhook', 'jwt')") cmd.Flags().StringVar(&flags.conciergeAuthenticatorName, "concierge-authenticator-name", "", "Concierge authenticator name") cmd.Flags().StringVar(&flags.conciergeEndpoint, "concierge-endpoint", "", "API base for the Pinniped concierge endpoint") cmd.Flags().StringVar(&flags.conciergeCABundle, "concierge-ca-bundle-data", "", "CA bundle to use when connecting to the concierge") cmd.Flags().StringVar(&flags.conciergeAPIGroupSuffix, "concierge-api-group-suffix", "pinniped.dev", "Concierge API group suffix") cmd.RunE = func(cmd *cobra.Command, args []string) error { return runStaticLogin(cmd.OutOrStdout(), deps, flags) } - return &cmd + + mustMarkDeprecated(cmd, "concierge-namespace", "not needed anymore") + mustMarkHidden(cmd, "concierge-namespace") + + return cmd } func runStaticLogin(out io.Writer, deps staticLoginDeps, flags staticLoginParams) error { @@ -81,7 +85,6 @@ func runStaticLogin(out io.Writer, deps staticLoginDeps, flags staticLoginParams if flags.conciergeEnabled { var err error concierge, err = conciergeclient.New( - conciergeclient.WithNamespace(flags.conciergeNamespace), conciergeclient.WithEndpoint(flags.conciergeEndpoint), conciergeclient.WithBase64CABundle(flags.conciergeCABundle), conciergeclient.WithAuthenticator(flags.conciergeAuthenticatorType, flags.conciergeAuthenticatorName), diff --git a/cmd/pinniped/cmd/login_static_test.go b/cmd/pinniped/cmd/login_static_test.go index 5d0114cb..6f9ced9e 100644 --- a/cmd/pinniped/cmd/login_static_test.go +++ b/cmd/pinniped/cmd/login_static_test.go @@ -56,7 +56,6 @@ func TestLoginStaticCommand(t *testing.T) { --concierge-authenticator-type string Concierge authenticator type (e.g., 'webhook', 'jwt') --concierge-ca-bundle-data string CA bundle to use when connecting to the concierge --concierge-endpoint string API base for the Pinniped concierge endpoint - --concierge-namespace string Namespace in which the concierge was installed (default "pinniped-concierge") --enable-concierge Exchange the token with the Pinniped concierge during login -h, --help help for static --token string Static token to present during login diff --git a/deploy/concierge/rbac.yaml b/deploy/concierge/rbac.yaml index b9165714..a54c94a2 100644 --- a/deploy/concierge/rbac.yaml +++ b/deploy/concierge/rbac.yaml @@ -31,6 +31,14 @@ rules: resources: [ securitycontextconstraints ] verbs: [ use ] resourceNames: [ nonroot ] + - apiGroups: + - #@ pinnipedDevAPIGroupWithPrefix("config.concierge") + resources: [ credentialissuers ] + verbs: [ get, list, watch, create, update ] + - apiGroups: + - #@ pinnipedDevAPIGroupWithPrefix("authentication.concierge") + resources: [ jwtauthenticators, webhookauthenticators ] + verbs: [ get, list, watch ] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -69,11 +77,6 @@ rules: - apiGroups: [ "" ] resources: [ pods/exec ] verbs: [ create ] - - apiGroups: - - #@ pinnipedDevAPIGroupWithPrefix("config.concierge") - - #@ pinnipedDevAPIGroupWithPrefix("authentication.concierge") - resources: [ "*" ] - verbs: [ create, get, list, update, watch ] - apiGroups: [apps] resources: [replicasets,deployments] verbs: [get] diff --git a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go index 71614492..4c54a37a 100644 --- a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go +++ b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go @@ -88,7 +88,7 @@ type controller struct { // Sync implements controllerlib.Syncer. func (c *controller) Sync(ctx controllerlib.Context) error { - obj, err := c.jwtAuthenticators.Lister().JWTAuthenticators(ctx.Key.Namespace).Get(ctx.Key.Name) + obj, err := c.jwtAuthenticators.Lister().Get(ctx.Key.Name) if err != nil && errors.IsNotFound(err) { c.log.Info("Sync() found that the JWTAuthenticator does not exist yet or was deleted") return nil diff --git a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go index 17b8073d..cd66fdcb 100644 --- a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go +++ b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go @@ -135,43 +135,41 @@ func TestController(t *testing.T) { }{ { name: "not found", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, wantLogs: []string{ `jwtcachefiller-controller "level"=0 "msg"="Sync() found that the JWTAuthenticator does not exist yet or was deleted"`, }, }, { name: "valid jwt authenticator with CA", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *someJWTAuthenticatorSpec, }, }, wantLogs: []string{ - `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name","namespace":"test-namespace"}`, + `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name"}`, }, wantCacheEntries: 1, runTestsOnResultingAuthenticator: true, }, { name: "valid jwt authenticator with custom username claim", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *someJWTAuthenticatorSpecWithUsernameClaim, }, }, wantLogs: []string{ - `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name","namespace":"test-namespace"}`, + `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name"}`, }, wantCacheEntries: 1, wantUsernameClaim: someJWTAuthenticatorSpecWithUsernameClaim.Claims.Username, @@ -179,18 +177,17 @@ func TestController(t *testing.T) { }, { name: "valid jwt authenticator with custom groups claim", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *someJWTAuthenticatorSpecWithGroupsClaim, }, }, wantLogs: []string{ - `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name","namespace":"test-namespace"}`, + `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name"}`, }, wantCacheEntries: 1, wantGroupsClaim: someJWTAuthenticatorSpecWithGroupsClaim.Claims.Groups, @@ -201,27 +198,25 @@ func TestController(t *testing.T) { cache: func(t *testing.T, cache *authncache.Cache, wantClose bool) { cache.Store( authncache.Key{ - Name: "test-name", - Namespace: "test-namespace", - Kind: "JWTAuthenticator", - APIGroup: auth1alpha1.SchemeGroupVersion.Group, + Name: "test-name", + Kind: "JWTAuthenticator", + APIGroup: auth1alpha1.SchemeGroupVersion.Group, }, newCacheValue(t, *otherJWTAuthenticatorSpec, wantClose), ) }, wantClose: true, - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *someJWTAuthenticatorSpec, }, }, wantLogs: []string{ - `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name","namespace":"test-namespace"}`, + `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name"}`, }, wantCacheEntries: 1, runTestsOnResultingAuthenticator: true, @@ -231,27 +226,25 @@ func TestController(t *testing.T) { cache: func(t *testing.T, cache *authncache.Cache, wantClose bool) { cache.Store( authncache.Key{ - Name: "test-name", - Namespace: "test-namespace", - Kind: "JWTAuthenticator", - APIGroup: auth1alpha1.SchemeGroupVersion.Group, + Name: "test-name", + Kind: "JWTAuthenticator", + APIGroup: auth1alpha1.SchemeGroupVersion.Group, }, newCacheValue(t, *someJWTAuthenticatorSpec, wantClose), ) }, wantClose: false, - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *someJWTAuthenticatorSpec, }, }, wantLogs: []string{ - `jwtcachefiller-controller "level"=0 "msg"="actual jwt authenticator and desired jwt authenticator are the same" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name","namespace":"test-namespace"}`, + `jwtcachefiller-controller "level"=0 "msg"="actual jwt authenticator and desired jwt authenticator are the same" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name"}`, }, wantCacheEntries: 1, runTestsOnResultingAuthenticator: false, // skip the tests because the authenticator left in the cache is the mock version that was added above @@ -261,57 +254,53 @@ func TestController(t *testing.T) { cache: func(t *testing.T, cache *authncache.Cache, wantClose bool) { cache.Store( authncache.Key{ - Name: "test-name", - Namespace: "test-namespace", - Kind: "JWTAuthenticator", - APIGroup: auth1alpha1.SchemeGroupVersion.Group, + Name: "test-name", + Kind: "JWTAuthenticator", + APIGroup: auth1alpha1.SchemeGroupVersion.Group, }, struct{ authenticator.Token }{}, ) }, - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *someJWTAuthenticatorSpec, }, }, wantLogs: []string{ `jwtcachefiller-controller "level"=0 "msg"="wrong JWT authenticator type in cache" "actualType"="struct { authenticator.Token }"`, - `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name","namespace":"test-namespace"}`, + `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name"}`, }, wantCacheEntries: 1, runTestsOnResultingAuthenticator: true, }, { name: "valid jwt authenticator without CA", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *missingTLSJWTAuthenticatorSpec, }, }, wantLogs: []string{ - `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name","namespace":"test-namespace"}`, + `jwtcachefiller-controller "level"=0 "msg"="added new jwt authenticator" "issuer"="` + goodIssuer + `" "jwtAuthenticator"={"name":"test-name"}`, }, wantCacheEntries: 1, runTestsOnResultingAuthenticator: false, // skip the tests because the authenticator left in the cache doesn't have the CA for our test discovery server }, { name: "invalid jwt authenticator CA", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, jwtAuthenticators: []runtime.Object{ &auth1alpha1.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: *invalidTLSJWTAuthenticatorSpec, }, diff --git a/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go b/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go index f729a07c..275f6859 100644 --- a/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go +++ b/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go @@ -54,7 +54,7 @@ type controller struct { // Sync implements controllerlib.Syncer. func (c *controller) Sync(ctx controllerlib.Context) error { - obj, err := c.webhooks.Lister().WebhookAuthenticators(ctx.Key.Namespace).Get(ctx.Key.Name) + obj, err := c.webhooks.Lister().Get(ctx.Key.Name) if err != nil && errors.IsNotFound(err) { c.log.Info("Sync() found that the WebhookAuthenticator does not exist yet or was deleted") return nil diff --git a/internal/controller/authenticator/webhookcachefiller/webhookcachefiller_test.go b/internal/controller/authenticator/webhookcachefiller/webhookcachefiller_test.go index 6b0bec0b..da6fe20f 100644 --- a/internal/controller/authenticator/webhookcachefiller/webhookcachefiller_test.go +++ b/internal/controller/authenticator/webhookcachefiller/webhookcachefiller_test.go @@ -41,19 +41,18 @@ func TestController(t *testing.T) { }{ { name: "not found", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, wantLogs: []string{ `webhookcachefiller-controller "level"=0 "msg"="Sync() found that the WebhookAuthenticator does not exist yet or was deleted"`, }, }, { name: "invalid webhook", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, webhooks: []runtime.Object{ &auth1alpha1.WebhookAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: auth1alpha1.WebhookAuthenticatorSpec{ Endpoint: "invalid url", @@ -64,12 +63,11 @@ func TestController(t *testing.T) { }, { name: "valid webhook", - syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, + syncKey: controllerlib.Key{Name: "test-name"}, webhooks: []runtime.Object{ &auth1alpha1.WebhookAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: "test-namespace", - Name: "test-name", + Name: "test-name", }, Spec: auth1alpha1.WebhookAuthenticatorSpec{ Endpoint: "https://example.com", @@ -78,7 +76,7 @@ func TestController(t *testing.T) { }, }, wantLogs: []string{ - `webhookcachefiller-controller "level"=0 "msg"="added new webhook authenticator" "endpoint"="https://example.com" "webhook"={"name":"test-name","namespace":"test-namespace"}`, + `webhookcachefiller-controller "level"=0 "msg"="added new webhook authenticator" "endpoint"="https://example.com" "webhook"={"name":"test-name"}`, }, wantCacheEntries: 1, }, diff --git a/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go b/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go index ff0c111e..859dc721 100644 --- a/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go +++ b/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go @@ -19,7 +19,6 @@ import ( func CreateOrUpdateCredentialIssuer( ctx context.Context, - credentialIssuerNamespace string, credentialIssuerResourceName string, credentialIssuerLabels map[string]string, pinnipedClient pinnipedclientset.Interface, @@ -28,7 +27,7 @@ func CreateOrUpdateCredentialIssuer( err := retry.RetryOnConflict(retry.DefaultRetry, func() error { existingCredentialIssuer, err := pinnipedClient. ConfigV1alpha1(). - CredentialIssuers(credentialIssuerNamespace). + CredentialIssuers(). Get(ctx, credentialIssuerResourceName, metav1.GetOptions{}) notFound := k8serrors.IsNotFound(err) @@ -36,12 +35,12 @@ func CreateOrUpdateCredentialIssuer( return fmt.Errorf("get failed: %w", err) } - credentialIssuersClient := pinnipedClient.ConfigV1alpha1().CredentialIssuers(credentialIssuerNamespace) + credentialIssuersClient := pinnipedClient.ConfigV1alpha1().CredentialIssuers() if notFound { // Create it credentialIssuer := minimalValidCredentialIssuer( - credentialIssuerResourceName, credentialIssuerNamespace, credentialIssuerLabels, + credentialIssuerResourceName, credentialIssuerLabels, ) applyUpdatesToCredentialIssuerFunc(credentialIssuer) @@ -73,15 +72,13 @@ func CreateOrUpdateCredentialIssuer( func minimalValidCredentialIssuer( credentialIssuerName string, - credentialIssuerNamespace string, credentialIssuerLabels map[string]string, ) *configv1alpha1.CredentialIssuer { return &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerName, - Namespace: credentialIssuerNamespace, - Labels: credentialIssuerLabels, + Name: credentialIssuerName, + Labels: credentialIssuerLabels, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{}, diff --git a/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go b/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go index 26b9edc0..9745545e 100644 --- a/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go +++ b/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go @@ -29,7 +29,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { var ctx context.Context var pinnipedAPIClient *pinnipedfake.Clientset var credentialIssuerGVR schema.GroupVersionResource - const installationNamespace = "some-namespace" const credentialIssuerResourceName = "some-resource-name" it.Before(func() { @@ -47,7 +46,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { it("creates a new config which includes only the updates made by the func parameter", func() { err := CreateOrUpdateCredentialIssuer( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{ "myLabelKey1": "myLabelValue1", @@ -62,16 +60,14 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { ) r.NoError(err) - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, installationNamespace, credentialIssuerResourceName) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewCreateAction( + expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, - installationNamespace, &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: installationNamespace, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", @@ -100,7 +96,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { it("returns an error", func() { err := CreateOrUpdateCredentialIssuer( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, @@ -118,8 +113,7 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { existingConfig = &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: installationNamespace, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", }, @@ -146,7 +140,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { it("updates the existing config to only apply the updates made by the func parameter", func() { err := CreateOrUpdateCredentialIssuer( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{ "myLabelKey1": "myLabelValue1", @@ -159,12 +152,12 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { ) r.NoError(err) - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, installationNamespace, credentialIssuerResourceName) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) // Only the edited field should be changed. expectedUpdatedConfig := existingConfig.DeepCopy() expectedUpdatedConfig.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" - expectedUpdateAction := coretesting.NewUpdateAction(credentialIssuerGVR, installationNamespace, expectedUpdatedConfig) + expectedUpdateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, expectedUpdatedConfig) r.Equal([]coretesting.Action{expectedGetAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) @@ -172,7 +165,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { it("avoids the cost of an update if the local updates made by the func parameter did not actually change anything", func() { err := CreateOrUpdateCredentialIssuer( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, @@ -187,7 +179,7 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { ) r.NoError(err) - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, installationNamespace, credentialIssuerResourceName) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) r.Equal([]coretesting.Action{expectedGetAction}, pinnipedAPIClient.Actions()) }) @@ -201,7 +193,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { it("returns an error", func() { err := CreateOrUpdateCredentialIssuer( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, @@ -221,7 +212,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { it("returns an error", func() { err := CreateOrUpdateCredentialIssuer( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, @@ -246,7 +236,7 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { if !hit { // Before the update fails, also change the object that will be returned by the next Get(), // to make sure that the production code does a fresh Get() after detecting a conflict. - r.NoError(pinnipedAPIClient.Tracker().Update(credentialIssuerGVR, slightlyDifferentExistingConfig, installationNamespace)) + r.NoError(pinnipedAPIClient.Tracker().Update(credentialIssuerGVR, slightlyDifferentExistingConfig, "")) hit = true return true, nil, apierrors.NewConflict(schema.GroupResource{ Group: apiregistrationv1.GroupName, @@ -260,7 +250,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { it("retries updates on conflict", func() { err := CreateOrUpdateCredentialIssuer( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{ "myLabelKey1": "myLabelValue1", @@ -273,18 +262,18 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { ) r.NoError(err) - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, installationNamespace, credentialIssuerResourceName) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) // The first attempted update only includes its own edits. firstExpectedUpdatedConfig := existingConfig.DeepCopy() firstExpectedUpdatedConfig.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" - firstExpectedUpdateAction := coretesting.NewUpdateAction(credentialIssuerGVR, installationNamespace, firstExpectedUpdatedConfig) + firstExpectedUpdateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, firstExpectedUpdatedConfig) // Both the edits made by this update and the edits made by the conflicting update should be included. secondExpectedUpdatedConfig := existingConfig.DeepCopy() secondExpectedUpdatedConfig.Status.KubeConfigInfo.Server = "some-other-server-value-from-conflicting-update" secondExpectedUpdatedConfig.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" - secondExpectedUpdateAction := coretesting.NewUpdateAction(credentialIssuerGVR, installationNamespace, secondExpectedUpdatedConfig) + secondExpectedUpdateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, secondExpectedUpdatedConfig) expectedActions := []coretesting.Action{ expectedGetAction, diff --git a/internal/controller/issuerconfig/kube_config_info_publisher.go b/internal/controller/issuerconfig/kube_config_info_publisher.go index b782c08b..09f883b4 100644 --- a/internal/controller/issuerconfig/kube_config_info_publisher.go +++ b/internal/controller/issuerconfig/kube_config_info_publisher.go @@ -26,19 +26,17 @@ const ( ) type kubeConigInfoPublisherController struct { - credentialIssuerNamespaceName string - credentialIssuerResourceName string - credentialIssuerLabels map[string]string - serverOverride *string - pinnipedClient pinnipedclientset.Interface - configMapInformer corev1informers.ConfigMapInformer + credentialIssuerResourceName string + credentialIssuerLabels map[string]string + serverOverride *string + pinnipedClient pinnipedclientset.Interface + configMapInformer corev1informers.ConfigMapInformer } // NewKubeConfigInfoPublisherController returns a controller that syncs the // configv1alpha1.CredentialIssuer.Status.KubeConfigInfo field with the cluster-info ConfigMap // in the kube-public namespace. func NewKubeConfigInfoPublisherController( - credentialIssuerNamespaceName string, credentialIssuerResourceName string, credentialIssuerLabels map[string]string, serverOverride *string, @@ -50,12 +48,11 @@ func NewKubeConfigInfoPublisherController( controllerlib.Config{ Name: "publisher-controller", Syncer: &kubeConigInfoPublisherController{ - credentialIssuerResourceName: credentialIssuerResourceName, - credentialIssuerNamespaceName: credentialIssuerNamespaceName, - credentialIssuerLabels: credentialIssuerLabels, - serverOverride: serverOverride, - pinnipedClient: pinnipedClient, - configMapInformer: configMapInformer, + credentialIssuerResourceName: credentialIssuerResourceName, + credentialIssuerLabels: credentialIssuerLabels, + serverOverride: serverOverride, + pinnipedClient: pinnipedClient, + configMapInformer: configMapInformer, }, }, withInformer( @@ -116,7 +113,6 @@ func (c *kubeConigInfoPublisherController) Sync(ctx controllerlib.Context) error return CreateOrUpdateCredentialIssuer( ctx.Context, - c.credentialIssuerNamespaceName, c.credentialIssuerResourceName, c.credentialIssuerLabels, c.pinnipedClient, diff --git a/internal/controller/issuerconfig/kube_config_info_publisher_test.go b/internal/controller/issuerconfig/kube_config_info_publisher_test.go index dc1cec1e..fd6a6624 100644 --- a/internal/controller/issuerconfig/kube_config_info_publisher_test.go +++ b/internal/controller/issuerconfig/kube_config_info_publisher_test.go @@ -30,7 +30,6 @@ import ( func TestInformerFilters(t *testing.T) { spec.Run(t, "informer filters", func(t *testing.T, when spec.G, it spec.S) { const credentialIssuerResourceName = "some-resource-name" - const installedInNamespace = "some-namespace" var r *require.Assertions var observableWithInformerOption *testutil.ObservableWithInformerOption @@ -41,7 +40,6 @@ func TestInformerFilters(t *testing.T) { observableWithInformerOption = testutil.NewObservableWithInformerOption() configMapInformer := kubeinformers.NewSharedInformerFactory(nil, 0).Core().V1().ConfigMaps() _ = NewKubeConfigInfoPublisherController( - installedInNamespace, credentialIssuerResourceName, map[string]string{}, nil, @@ -105,7 +103,6 @@ func TestInformerFilters(t *testing.T) { func TestSync(t *testing.T) { spec.Run(t, "Sync", func(t *testing.T, when spec.G, it spec.S) { const credentialIssuerResourceName = "some-resource-name" - const installedInNamespace = "some-namespace" var r *require.Assertions @@ -118,7 +115,7 @@ func TestSync(t *testing.T) { var timeoutContextCancel context.CancelFunc var syncContext *controllerlib.Context - var expectedCredentialIssuer = func(expectedNamespace, expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *configv1alpha1.CredentialIssuer) { + var expectedCredentialIssuer = func(expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *configv1alpha1.CredentialIssuer) { expectedCredentialIssuerGVR := schema.GroupVersionResource{ Group: configv1alpha1.GroupName, Version: "v1alpha1", @@ -126,8 +123,7 @@ func TestSync(t *testing.T) { } expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: expectedNamespace, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", @@ -149,7 +145,6 @@ func TestSync(t *testing.T) { var startInformersAndController = func() { // Set this at the last second to allow for injection of server override. subject = NewKubeConfigInfoPublisherController( - installedInNamespace, credentialIssuerResourceName, map[string]string{ "myLabelKey1": "myLabelValue1", @@ -223,17 +218,15 @@ func TestSync(t *testing.T) { r.NoError(err) expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( - installedInNamespace, kubeServerURL, caData, ) r.Equal( []coretesting.Action{ - coretesting.NewGetAction(expectedCredentialIssuerGVR, installedInNamespace, expectedCredentialIssuer.Name), - coretesting.NewCreateAction( + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCredentialIssuer.Name), + coretesting.NewRootCreateAction( expectedCredentialIssuerGVR, - installedInNamespace, expectedCredentialIssuer, ), }, @@ -269,7 +262,6 @@ func TestSync(t *testing.T) { r.NoError(err) expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( - installedInNamespace, kubeServerURL, caData, ) @@ -277,10 +269,9 @@ func TestSync(t *testing.T) { r.Equal( []coretesting.Action{ - coretesting.NewGetAction(expectedCredentialIssuerGVR, installedInNamespace, expectedCredentialIssuer.Name), - coretesting.NewCreateAction( + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCredentialIssuer.Name), + coretesting.NewRootCreateAction( expectedCredentialIssuerGVR, - installedInNamespace, expectedCredentialIssuer, ), }, @@ -297,7 +288,6 @@ func TestSync(t *testing.T) { it.Before(func() { credentialIssuerGVR, credentialIssuer = expectedCredentialIssuer( - installedInNamespace, kubeServerURL, caData, ) @@ -312,7 +302,7 @@ func TestSync(t *testing.T) { r.Equal( []coretesting.Action{ - coretesting.NewGetAction(credentialIssuerGVR, installedInNamespace, credentialIssuer.Name), + coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuer.Name), }, pinnipedAPIClient.Actions(), ) @@ -322,7 +312,6 @@ func TestSync(t *testing.T) { when("the CredentialIssuer is stale compared to the data in the ConfigMap", func() { it.Before(func() { _, expectedCredentialIssuer := expectedCredentialIssuer( - installedInNamespace, kubeServerURL, caData, ) @@ -336,15 +325,13 @@ func TestSync(t *testing.T) { r.NoError(err) expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( - installedInNamespace, kubeServerURL, caData, ) expectedActions := []coretesting.Action{ - coretesting.NewGetAction(expectedCredentialIssuerGVR, installedInNamespace, expectedCredentialIssuer.Name), - coretesting.NewUpdateAction( + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCredentialIssuer.Name), + coretesting.NewRootUpdateAction( expectedCredentialIssuerGVR, - installedInNamespace, expectedCredentialIssuer, ), } diff --git a/internal/controller/kubecertagent/annotater_test.go b/internal/controller/kubecertagent/annotater_test.go index 1674700f..ea3db3e3 100644 --- a/internal/controller/kubecertagent/annotater_test.go +++ b/internal/controller/kubecertagent/annotater_test.go @@ -59,7 +59,6 @@ func TestAnnotaterControllerSync(t *testing.T) { const agentPodNamespace = "agent-pod-namespace" const defaultKubeControllerManagerClusterSigningCertFileFlagValue = "/etc/kubernetes/ca/ca.pem" const defaultKubeControllerManagerClusterSigningKeyFileFlagValue = "/etc/kubernetes/ca/ca.key" - const credentialIssuerNamespaceName = "ci-namespace-name" const credentialIssuerResourceName = "ci-resource-name" const ( @@ -102,8 +101,7 @@ func TestAnnotaterControllerSync(t *testing.T) { }, }, &CredentialIssuerLocationConfig{ - Namespace: credentialIssuerNamespaceName, - Name: credentialIssuerResourceName, + Name: credentialIssuerResourceName, }, clock.NewFakeClock(frozenNow), kubeAPIClient, @@ -236,8 +234,7 @@ func TestAnnotaterControllerSync(t *testing.T) { initialCredentialIssuer = &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{}, @@ -264,14 +261,12 @@ func TestAnnotaterControllerSync(t *testing.T) { LastUpdateTime: metav1.NewTime(frozenNow), }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, expectedCredentialIssuer, ) @@ -312,8 +307,7 @@ func TestAnnotaterControllerSync(t *testing.T) { expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -327,14 +321,12 @@ func TestAnnotaterControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedCreateAction := coretesting.NewCreateAction( + expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, expectedCredentialIssuer, ) diff --git a/internal/controller/kubecertagent/creater_test.go b/internal/controller/kubecertagent/creater_test.go index 70643f85..d63363c1 100644 --- a/internal/controller/kubecertagent/creater_test.go +++ b/internal/controller/kubecertagent/creater_test.go @@ -83,7 +83,6 @@ func TestCreaterControllerSync(t *testing.T) { spec.Run(t, "CreaterControllerSync", func(t *testing.T, when spec.G, it spec.S) { const kubeSystemNamespace = "kube-system" const agentPodNamespace = "agent-pod-namespace" - const credentialIssuerNamespaceName = "ci-namespace-name" const credentialIssuerResourceName = "ci-resource-name" var r *require.Assertions @@ -119,8 +118,7 @@ func TestCreaterControllerSync(t *testing.T) { }, }, &CredentialIssuerLocationConfig{ - Namespace: credentialIssuerNamespaceName, - Name: credentialIssuerResourceName, + Name: credentialIssuerResourceName, }, map[string]string{ "myLabelKey1": "myLabelValue1", @@ -307,8 +305,7 @@ func TestCreaterControllerSync(t *testing.T) { initialCredentialIssuer = &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{}, @@ -335,14 +332,12 @@ func TestCreaterControllerSync(t *testing.T) { LastUpdateTime: metav1.NewTime(frozenNow), }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, expectedCredentialIssuer, ) @@ -383,8 +378,7 @@ func TestCreaterControllerSync(t *testing.T) { expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", @@ -402,14 +396,12 @@ func TestCreaterControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedCreateAction := coretesting.NewCreateAction( + expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, expectedCredentialIssuer, ) @@ -435,8 +427,7 @@ func TestCreaterControllerSync(t *testing.T) { initialCredentialIssuer = &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{}, @@ -463,14 +454,12 @@ func TestCreaterControllerSync(t *testing.T) { LastUpdateTime: metav1.NewTime(frozenNow), }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, expectedCredentialIssuer, ) @@ -528,8 +517,7 @@ func TestCreaterControllerSync(t *testing.T) { expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", @@ -547,14 +535,12 @@ func TestCreaterControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedCreateAction := coretesting.NewCreateAction( + expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, expectedCredentialIssuer, ) diff --git a/internal/controller/kubecertagent/execer_test.go b/internal/controller/kubecertagent/execer_test.go index 8ca37e25..e7ae425a 100644 --- a/internal/controller/kubecertagent/execer_test.go +++ b/internal/controller/kubecertagent/execer_test.go @@ -44,8 +44,7 @@ func TestExecerControllerOptions(t *testing.T) { agentPodsInformer := kubeinformers.NewSharedInformerFactory(nil, 0).Core().V1().Pods() _ = NewExecerController( &CredentialIssuerLocationConfig{ - Namespace: "ignored by this test", - Name: "ignored by this test", + Name: "ignored by this test", }, nil, // dynamicCertProvider, not needed for this test nil, // podCommandExecutor, not needed for this test @@ -136,7 +135,6 @@ func TestManagerControllerSync(t *testing.T) { const fakeKeyPath = "/some/key/path" const defaultDynamicCertProviderCert = "initial-cert" const defaultDynamicCertProviderKey = "initial-key" - const credentialIssuerNamespaceName = "ci-namespace-name" const credentialIssuerResourceName = "ci-resource-name" var r *require.Assertions @@ -160,8 +158,7 @@ func TestManagerControllerSync(t *testing.T) { // Set this at the last second to allow for injection of server override. subject = NewExecerController( &CredentialIssuerLocationConfig{ - Namespace: credentialIssuerNamespaceName, - Name: credentialIssuerResourceName, + Name: credentialIssuerResourceName, }, dynamicCertProvider, fakeExecutor, @@ -333,8 +330,7 @@ func TestManagerControllerSync(t *testing.T) { initialCredentialIssuer = &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{}, @@ -361,8 +357,8 @@ func TestManagerControllerSync(t *testing.T) { LastUpdateTime: metav1.NewTime(frozenNow), }, } - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, credentialIssuerNamespaceName, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewUpdateAction(credentialIssuerGVR, credentialIssuerNamespaceName, expectedCredentialIssuer) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) + expectedCreateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, expectedCredentialIssuer) r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) }) @@ -396,8 +392,7 @@ func TestManagerControllerSync(t *testing.T) { expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -411,8 +406,8 @@ func TestManagerControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, credentialIssuerNamespaceName, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewCreateAction(credentialIssuerGVR, credentialIssuerNamespaceName, expectedCredentialIssuer) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCredentialIssuer) r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) }) }) @@ -439,8 +434,7 @@ func TestManagerControllerSync(t *testing.T) { expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -454,8 +448,8 @@ func TestManagerControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, credentialIssuerNamespaceName, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewCreateAction(credentialIssuerGVR, credentialIssuerNamespaceName, expectedCredentialIssuer) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCredentialIssuer) r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) }) }) @@ -481,8 +475,7 @@ func TestManagerControllerSync(t *testing.T) { expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -496,8 +489,8 @@ func TestManagerControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, credentialIssuerNamespaceName, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewCreateAction(credentialIssuerGVR, credentialIssuerNamespaceName, expectedCredentialIssuer) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCredentialIssuer) r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) }) }) diff --git a/internal/controller/kubecertagent/kubecertagent.go b/internal/controller/kubecertagent/kubecertagent.go index cb32d0b3..1dfe7a67 100644 --- a/internal/controller/kubecertagent/kubecertagent.go +++ b/internal/controller/kubecertagent/kubecertagent.go @@ -74,9 +74,6 @@ type AgentPodConfig struct { } type CredentialIssuerLocationConfig struct { - // The namespace in which the CredentialIssuer should be created/updated. - Namespace string - // The resource name for the CredentialIssuer to be created/updated. Name string } @@ -292,7 +289,6 @@ func createOrUpdateCredentialIssuer(ctx context.Context, ) error { return issuerconfig.CreateOrUpdateCredentialIssuer( ctx, - ciConfig.Namespace, ciConfig.Name, credentialIssuerLabels, pinnipedAPIClient, diff --git a/internal/controllermanager/prepare_controllers.go b/internal/controllermanager/prepare_controllers.go index cbc3f069..6e3e0b75 100644 --- a/internal/controllermanager/prepare_controllers.go +++ b/internal/controllermanager/prepare_controllers.go @@ -109,8 +109,7 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { AdditionalLabels: c.Labels, } credentialIssuerLocationConfig := &kubecertagent.CredentialIssuerLocationConfig{ - Namespace: c.ServerInstallationInfo.Namespace, - Name: c.NamesConfig.CredentialIssuer, + Name: c.NamesConfig.CredentialIssuer, } groupName, ok := groupsuffix.Replace(loginv1alpha1.GroupName, c.APIGroupSuffix) @@ -127,7 +126,6 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { // CredentialIssuer resource and keeping that information up to date. WithController( issuerconfig.NewKubeConfigInfoPublisherController( - c.ServerInstallationInfo.Namespace, c.NamesConfig.CredentialIssuer, c.Labels, c.DiscoveryURLOverride, @@ -245,7 +243,7 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { WithController( webhookcachefiller.New( c.AuthenticatorCache, - informers.installationNamespacePinniped.Authentication().V1alpha1().WebhookAuthenticators(), + informers.pinniped.Authentication().V1alpha1().WebhookAuthenticators(), klogr.New(), ), singletonWorker, @@ -253,7 +251,7 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { WithController( jwtcachefiller.New( c.AuthenticatorCache, - informers.installationNamespacePinniped.Authentication().V1alpha1().JWTAuthenticators(), + informers.pinniped.Authentication().V1alpha1().JWTAuthenticators(), klogr.New(), ), singletonWorker, @@ -261,8 +259,8 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { WithController( cachecleaner.New( c.AuthenticatorCache, - informers.installationNamespacePinniped.Authentication().V1alpha1().WebhookAuthenticators(), - informers.installationNamespacePinniped.Authentication().V1alpha1().JWTAuthenticators(), + informers.pinniped.Authentication().V1alpha1().WebhookAuthenticators(), + informers.pinniped.Authentication().V1alpha1().JWTAuthenticators(), klogr.New(), ), singletonWorker, @@ -276,10 +274,10 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { } type informers struct { - kubePublicNamespaceK8s k8sinformers.SharedInformerFactory - kubeSystemNamespaceK8s k8sinformers.SharedInformerFactory - installationNamespaceK8s k8sinformers.SharedInformerFactory - installationNamespacePinniped pinnipedinformers.SharedInformerFactory + kubePublicNamespaceK8s k8sinformers.SharedInformerFactory + kubeSystemNamespaceK8s k8sinformers.SharedInformerFactory + installationNamespaceK8s k8sinformers.SharedInformerFactory + pinniped pinnipedinformers.SharedInformerFactory } // Create the informers that will be used by the controllers. @@ -304,10 +302,9 @@ func createInformers( defaultResyncInterval, k8sinformers.WithNamespace(serverInstallationNamespace), ), - installationNamespacePinniped: pinnipedinformers.NewSharedInformerFactoryWithOptions( + pinniped: pinnipedinformers.NewSharedInformerFactoryWithOptions( pinnipedClient, defaultResyncInterval, - pinnipedinformers.WithNamespace(serverInstallationNamespace), ), } } @@ -316,10 +313,10 @@ func (i *informers) startAndWaitForSync(ctx context.Context) { i.kubePublicNamespaceK8s.Start(ctx.Done()) i.kubeSystemNamespaceK8s.Start(ctx.Done()) i.installationNamespaceK8s.Start(ctx.Done()) - i.installationNamespacePinniped.Start(ctx.Done()) + i.pinniped.Start(ctx.Done()) i.kubePublicNamespaceK8s.WaitForCacheSync(ctx.Done()) i.kubeSystemNamespaceK8s.WaitForCacheSync(ctx.Done()) i.installationNamespaceK8s.WaitForCacheSync(ctx.Done()) - i.installationNamespacePinniped.WaitForCacheSync(ctx.Done()) + i.pinniped.WaitForCacheSync(ctx.Done()) } diff --git a/internal/kubeclient/kubeclient_test.go b/internal/kubeclient/kubeclient_test.go index cd79a920..dba289e7 100644 --- a/internal/kubeclient/kubeclient_test.go +++ b/internal/kubeclient/kubeclient_test.go @@ -259,7 +259,7 @@ func TestKubeclient(t *testing.T) { // create tokenCredentialRequest, err := c.PinnipedConcierge. LoginV1alpha1(). - TokenCredentialRequests(goodTokenCredentialRequest.Namespace). + TokenCredentialRequests(). Create(context.Background(), goodTokenCredentialRequest, metav1.CreateOptions{}) require.NoError(t, err) require.Equal(t, goodTokenCredentialRequest, tokenCredentialRequest) @@ -267,7 +267,7 @@ func TestKubeclient(t *testing.T) { // read tokenCredentialRequest, err = c.PinnipedConcierge. LoginV1alpha1(). - TokenCredentialRequests(tokenCredentialRequest.Namespace). + TokenCredentialRequests(). Get(context.Background(), tokenCredentialRequest.Name, metav1.GetOptions{}) require.NoError(t, err) require.Equal(t, with(goodTokenCredentialRequest, annotations(), labels()), tokenCredentialRequest) @@ -276,7 +276,7 @@ func TestKubeclient(t *testing.T) { goodTokenCredentialRequestWithAnnotationsAndLabelsAndClusterName := with(goodTokenCredentialRequest, annotations(), labels(), clusterName()).(*loginv1alpha1.TokenCredentialRequest) tokenCredentialRequest, err = c.PinnipedConcierge. LoginV1alpha1(). - TokenCredentialRequests(tokenCredentialRequest.Namespace). + TokenCredentialRequests(). Update(context.Background(), goodTokenCredentialRequestWithAnnotationsAndLabelsAndClusterName, metav1.UpdateOptions{}) require.NoError(t, err) require.Equal(t, goodTokenCredentialRequestWithAnnotationsAndLabelsAndClusterName, tokenCredentialRequest) @@ -284,7 +284,7 @@ func TestKubeclient(t *testing.T) { // delete err = c.PinnipedConcierge. LoginV1alpha1(). - TokenCredentialRequests(tokenCredentialRequest.Namespace). + TokenCredentialRequests(). Delete(context.Background(), tokenCredentialRequest.Name, metav1.DeleteOptions{}) require.NoError(t, err) }, diff --git a/pkg/conciergeclient/conciergeclient.go b/pkg/conciergeclient/conciergeclient.go index 0bebd3d2..5943e24c 100644 --- a/pkg/conciergeclient/conciergeclient.go +++ b/pkg/conciergeclient/conciergeclient.go @@ -27,28 +27,19 @@ import ( ) // ErrLoginFailed is returned by Client.ExchangeToken when the concierge server rejects the login request for any reason. -var ErrLoginFailed = constable.Error("login failed") +const ErrLoginFailed = constable.Error("login failed") // Option is an optional configuration for New(). type Option func(*Client) error // Client is a configuration for talking to the Pinniped concierge. type Client struct { - namespace string authenticator *corev1.TypedLocalObjectReference caBundle string endpoint *url.URL apiGroupSuffix string } -// WithNamespace configures the namespace where the TokenCredentialRequest is to be sent. -func WithNamespace(namespace string) Option { - return func(c *Client) error { - c.namespace = namespace - return nil - } -} - // WithAuthenticator configures the authenticator reference (spec.authenticator) of the TokenCredentialRequests. func WithAuthenticator(authType, authName string) Option { return func(c *Client) error { @@ -127,7 +118,7 @@ func WithAPIGroupSuffix(apiGroupSuffix string) Option { // New validates the specified options and returns a newly initialized *Client. func New(opts ...Option) (*Client, error) { - c := Client{namespace: "pinniped-concierge", apiGroupSuffix: "pinniped.dev"} + c := Client{apiGroupSuffix: "pinniped.dev"} for _, opt := range opts { if err := opt(&c); err != nil { return nil, err @@ -180,10 +171,7 @@ func (c *Client) ExchangeToken(ctx context.Context, token string) (*clientauthen if err != nil { return nil, err } - resp, err := clientset.LoginV1alpha1().TokenCredentialRequests(c.namespace).Create(ctx, &loginv1alpha1.TokenCredentialRequest{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: c.namespace, - }, + resp, err := clientset.LoginV1alpha1().TokenCredentialRequests().Create(ctx, &loginv1alpha1.TokenCredentialRequest{ Spec: loginv1alpha1.TokenCredentialRequestSpec{ Token: token, Authenticator: *c.authenticator, diff --git a/pkg/conciergeclient/conciergeclient_test.go b/pkg/conciergeclient/conciergeclient_test.go index c4f6702d..9a0a1500 100644 --- a/pkg/conciergeclient/conciergeclient_test.go +++ b/pkg/conciergeclient/conciergeclient_test.go @@ -125,7 +125,6 @@ func TestNew(t *testing.T) { { name: "valid", opts: []Option{ - WithNamespace("test-namespace"), WithEndpoint("https://example.com"), WithCABundle(""), WithCABundle(string(testCA.Bundle())), @@ -223,7 +222,7 @@ func TestExchangeToken(t *testing.T) { // Start a test server that returns successfully and asserts various properties of the request. caBundle, endpoint := testutil.TLSTestServer(t, func(w http.ResponseWriter, r *http.Request) { require.Equal(t, http.MethodPost, r.Method) - require.Equal(t, "/apis/login.concierge.pinniped.dev/v1alpha1/namespaces/test-namespace/tokencredentialrequests", r.URL.Path) + require.Equal(t, "/apis/login.concierge.pinniped.dev/v1alpha1/tokencredentialrequests", r.URL.Path) require.Equal(t, "application/json", r.Header.Get("content-type")) body, err := ioutil.ReadAll(r.Body) @@ -233,8 +232,7 @@ func TestExchangeToken(t *testing.T) { "kind": "TokenCredentialRequest", "apiVersion": "login.concierge.pinniped.dev/v1alpha1", "metadata": { - "creationTimestamp": null, - "namespace": "test-namespace" + "creationTimestamp": null }, "spec": { "token": "test-token", @@ -262,7 +260,7 @@ func TestExchangeToken(t *testing.T) { }) }) - client, err := New(WithNamespace("test-namespace"), WithEndpoint(endpoint), WithCABundle(caBundle), WithAuthenticator("webhook", "test-webhook")) + client, err := New(WithEndpoint(endpoint), WithCABundle(caBundle), WithAuthenticator("webhook", "test-webhook")) require.NoError(t, err) got, err := client.ExchangeToken(ctx, "test-token") diff --git a/site/content/docs/concierge-and-supervisor-demo.md b/site/content/docs/concierge-and-supervisor-demo.md index b268affa..0274c409 100644 --- a/site/content/docs/concierge-and-supervisor-demo.md +++ b/site/content/docs/concierge-and-supervisor-demo.md @@ -163,7 +163,7 @@ to authenticate federated identities from the Supervisor. object to configure the Pinniped Concierge to authenticate using the Pinniped Supervisor. ```bash - cat < /tmp/pinniped-kubeconfig ``` diff --git a/site/content/docs/concierge-only-demo.md b/site/content/docs/concierge-only-demo.md index e07b3650..8ecfa94a 100644 --- a/site/content/docs/concierge-only-demo.md +++ b/site/content/docs/concierge-only-demo.md @@ -102,7 +102,7 @@ as the authenticator. 1. Create a `WebhookAuthenticator` object to configure the Pinniped Concierge to authenticate using local-user-authenticator. ```bash - cat < /tmp/pinniped-kubeconfig + pinniped get kubeconfig --static-token "pinny-the-seal:password123" --concierge-authenticator-type webhook --concierge-authenticator-name local-user-authenticator > /tmp/pinniped-kubeconfig ``` If you are using MacOS, you may get an error dialog that says diff --git a/test/integration/cli_test.go b/test/integration/cli_test.go index 7b33ca37..910d1ac4 100644 --- a/test/integration/cli_test.go +++ b/test/integration/cli_test.go @@ -57,7 +57,6 @@ func TestCLIGetKubeconfigStaticToken(t *testing.T) { "get", "kubeconfig", "--static-token", env.TestUser.Token, "--concierge-api-group-suffix", env.APIGroupSuffix, - "--concierge-namespace", env.ConciergeNamespace, "--concierge-authenticator-type", "webhook", "--concierge-authenticator-name", authenticator.Name, }, diff --git a/test/integration/concierge_api_serving_certs_test.go b/test/integration/concierge_api_serving_certs_test.go index a0a67acf..b912073d 100644 --- a/test/integration/concierge_api_serving_certs_test.go +++ b/test/integration/concierge_api_serving_certs_test.go @@ -146,7 +146,7 @@ func TestAPIServingCertificateAutoCreationAndRotation(t *testing.T) { // pod has rotated their cert, but not the other ones sitting behind the service. aggregatedAPIWorking := func() bool { for i := 0; i < 10; i++ { - _, err = conciergeClient.LoginV1alpha1().TokenCredentialRequests(env.ConciergeNamespace).Create(ctx, &loginv1alpha1.TokenCredentialRequest{ + _, err = conciergeClient.LoginV1alpha1().TokenCredentialRequests().Create(ctx, &loginv1alpha1.TokenCredentialRequest{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{}, Spec: loginv1alpha1.TokenCredentialRequestSpec{Token: "not a good token", Authenticator: testWebhook}, diff --git a/test/integration/concierge_client_test.go b/test/integration/concierge_client_test.go index 5098664c..1cad0de5 100644 --- a/test/integration/concierge_client_test.go +++ b/test/integration/concierge_client_test.go @@ -72,7 +72,6 @@ func TestClient(t *testing.T) { // Using the CA bundle and host from the current (admin) kubeconfig, do the token exchange. clientConfig := library.NewClientConfig(t) client, err := conciergeclient.New( - conciergeclient.WithNamespace(env.ConciergeNamespace), conciergeclient.WithCABundle(string(clientConfig.CAData)), conciergeclient.WithEndpoint(clientConfig.Host), conciergeclient.WithAuthenticator("webhook", webhook.Name), diff --git a/test/integration/concierge_credentialissuerconfig_test.go b/test/integration/concierge_credentialissuerconfig_test.go index 065fcf8c..583a0250 100644 --- a/test/integration/concierge_credentialissuerconfig_test.go +++ b/test/integration/concierge_credentialissuerconfig_test.go @@ -29,7 +29,7 @@ func TestCredentialIssuer(t *testing.T) { t.Run("test successful CredentialIssuer", func(t *testing.T) { actualConfigList, err := client. ConfigV1alpha1(). - CredentialIssuers(env.ConciergeNamespace). + CredentialIssuers(). List(ctx, metav1.ListOptions{}) require.NoError(t, err) diff --git a/test/integration/concierge_credentialrequest_test.go b/test/integration/concierge_credentialrequest_test.go index 46ad2357..6f8236b7 100644 --- a/test/integration/concierge_credentialrequest_test.go +++ b/test/integration/concierge_credentialrequest_test.go @@ -211,7 +211,7 @@ func makeRequest(ctx context.Context, t *testing.T, spec loginv1alpha1.TokenCred ctx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() - return client.LoginV1alpha1().TokenCredentialRequests(env.ConciergeNamespace).Create(ctx, &loginv1alpha1.TokenCredentialRequest{ + return client.LoginV1alpha1().TokenCredentialRequests().Create(ctx, &loginv1alpha1.TokenCredentialRequest{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{Namespace: env.ConciergeNamespace}, Spec: spec, diff --git a/test/integration/e2e_test.go b/test/integration/e2e_test.go index 86f21599..42f51eb1 100644 --- a/test/integration/e2e_test.go +++ b/test/integration/e2e_test.go @@ -142,7 +142,6 @@ func TestE2EFullIntegration(t *testing.T) { // Run "pinniped get kubeconfig" to get a kubeconfig YAML. kubeconfigYAML, stderr := runPinnipedCLI(t, pinnipedExe, "get", "kubeconfig", "--concierge-api-group-suffix", env.APIGroupSuffix, - "--concierge-namespace", env.ConciergeNamespace, "--concierge-authenticator-type", "jwt", "--concierge-authenticator-name", authenticator.Name, "--oidc-skip-browser", diff --git a/test/integration/kubeclient_test.go b/test/integration/kubeclient_test.go index 211287f1..c8580e14 100644 --- a/test/integration/kubeclient_test.go +++ b/test/integration/kubeclient_test.go @@ -167,7 +167,7 @@ func TestKubeClientOwnerRef(t *testing.T) { require.NoError(t, err) // sanity check concierge client - credentialIssuer, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers(namespace.Name).Create( + credentialIssuer, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers().Create( ctx, &conciergeconfigv1alpha1.CredentialIssuer{ ObjectMeta: metav1.ObjectMeta{ @@ -184,7 +184,7 @@ func TestKubeClientOwnerRef(t *testing.T) { hasOwnerRef(t, credentialIssuer, ref) // this owner has already been deleted so the cred issuer should be immediately deleted isEventuallyDeleted(t, func() error { - _, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers(namespace.Name).Get(ctx, credentialIssuer.Name, metav1.GetOptions{}) + _, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers().Get(ctx, credentialIssuer.Name, metav1.GetOptions{}) return err }) diff --git a/test/library/client.go b/test/library/client.go index 011f2b77..a98034d8 100644 --- a/test/library/client.go +++ b/test/library/client.go @@ -153,7 +153,7 @@ func CreateTestWebhookAuthenticator(ctx context.Context, t *testing.T) corev1.Ty testEnv := IntegrationEnv(t) client := NewConciergeClientset(t) - webhooks := client.AuthenticationV1alpha1().WebhookAuthenticators(testEnv.ConciergeNamespace) + webhooks := client.AuthenticationV1alpha1().WebhookAuthenticators() createContext, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() @@ -220,10 +220,9 @@ func CreateTestJWTAuthenticatorForCLIUpstream(ctx context.Context, t *testing.T) // authenticator within the test namespace. func CreateTestJWTAuthenticator(ctx context.Context, t *testing.T, spec auth1alpha1.JWTAuthenticatorSpec) corev1.TypedLocalObjectReference { t.Helper() - testEnv := IntegrationEnv(t) client := NewConciergeClientset(t) - jwtAuthenticators := client.AuthenticationV1alpha1().JWTAuthenticators(testEnv.ConciergeNamespace) + jwtAuthenticators := client.AuthenticationV1alpha1().JWTAuthenticators() createContext, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() From d25c6d9d0a34acc5e58000f50d0d172b3c7f8622 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Tue, 9 Feb 2021 16:17:53 -0500 Subject: [PATCH 04/15] Make kubebuilder CRDs cluster scoped Signed-off-by: Monis Khan --- apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl | 2 +- apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl | 2 +- apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl index 480b1015..74b2986d 100644 --- a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl @@ -59,7 +59,7 @@ type JWTTokenClaims struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl index 32062949..b2d1cd4a 100644 --- a/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl @@ -31,7 +31,7 @@ type WebhookAuthenticatorSpec struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl index c0425a79..17e8a5eb 100644 --- a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl +++ b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl @@ -69,7 +69,7 @@ type CredentialIssuerStrategy struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped +// +kubebuilder:resource:categories=pinniped,scope=Cluster type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` From 741b8fe88d61f00ecf139a5752f37eb6bbfe3afc Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Tue, 9 Feb 2021 16:21:17 -0500 Subject: [PATCH 05/15] Generated Signed-off-by: Monis Khan --- ...authentication.concierge.pinniped.dev_jwtauthenticators.yaml | 2 +- ...entication.concierge.pinniped.dev_webhookauthenticators.yaml | 2 +- .../config.concierge.pinniped.dev_credentialissuers.yaml | 2 +- .../1.17/apis/concierge/authentication/v1alpha1/types_jwt.go | 2 +- .../apis/concierge/authentication/v1alpha1/types_webhook.go | 2 +- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 2 +- ...authentication.concierge.pinniped.dev_jwtauthenticators.yaml | 2 +- ...entication.concierge.pinniped.dev_webhookauthenticators.yaml | 2 +- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 +- .../1.18/apis/concierge/authentication/v1alpha1/types_jwt.go | 2 +- .../apis/concierge/authentication/v1alpha1/types_webhook.go | 2 +- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 2 +- ...authentication.concierge.pinniped.dev_jwtauthenticators.yaml | 2 +- ...entication.concierge.pinniped.dev_webhookauthenticators.yaml | 2 +- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 +- .../1.19/apis/concierge/authentication/v1alpha1/types_jwt.go | 2 +- .../apis/concierge/authentication/v1alpha1/types_webhook.go | 2 +- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 2 +- ...authentication.concierge.pinniped.dev_jwtauthenticators.yaml | 2 +- ...entication.concierge.pinniped.dev_webhookauthenticators.yaml | 2 +- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 +- .../1.20/apis/concierge/authentication/v1alpha1/types_jwt.go | 2 +- .../apis/concierge/authentication/v1alpha1/types_webhook.go | 2 +- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 2 +- ...authentication.concierge.pinniped.dev_jwtauthenticators.yaml | 2 +- ...entication.concierge.pinniped.dev_webhookauthenticators.yaml | 2 +- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..59facfd0 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: JWTAuthenticatorList plural: jwtauthenticators singular: jwtauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.issuer diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index d31bae12..a23e8fcf 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: WebhookAuthenticatorList plural: webhookauthenticators singular: webhookauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.endpoint diff --git a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml index 9b4c0056..87a454a7 100644 --- a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml @@ -16,7 +16,7 @@ spec: listKind: CredentialIssuerList plural: credentialissuers singular: credentialissuer - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: diff --git a/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go index 480b1015..74b2986d 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -59,7 +59,7 @@ type JWTTokenClaims struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go index 32062949..b2d1cd4a 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -31,7 +31,7 @@ type WebhookAuthenticatorSpec struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go index c0425a79..17e8a5eb 100644 --- a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -69,7 +69,7 @@ type CredentialIssuerStrategy struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped +// +kubebuilder:resource:categories=pinniped,scope=Cluster type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..59facfd0 100644 --- a/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: JWTAuthenticatorList plural: jwtauthenticators singular: jwtauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.issuer diff --git a/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index d31bae12..a23e8fcf 100644 --- a/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: WebhookAuthenticatorList plural: webhookauthenticators singular: webhookauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.endpoint diff --git a/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 9b4c0056..87a454a7 100644 --- a/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -16,7 +16,7 @@ spec: listKind: CredentialIssuerList plural: credentialissuers singular: credentialissuer - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: diff --git a/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go index 480b1015..74b2986d 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -59,7 +59,7 @@ type JWTTokenClaims struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go index 32062949..b2d1cd4a 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -31,7 +31,7 @@ type WebhookAuthenticatorSpec struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go index c0425a79..17e8a5eb 100644 --- a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -69,7 +69,7 @@ type CredentialIssuerStrategy struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped +// +kubebuilder:resource:categories=pinniped,scope=Cluster type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..59facfd0 100644 --- a/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: JWTAuthenticatorList plural: jwtauthenticators singular: jwtauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.issuer diff --git a/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index d31bae12..a23e8fcf 100644 --- a/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: WebhookAuthenticatorList plural: webhookauthenticators singular: webhookauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.endpoint diff --git a/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 9b4c0056..87a454a7 100644 --- a/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -16,7 +16,7 @@ spec: listKind: CredentialIssuerList plural: credentialissuers singular: credentialissuer - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: diff --git a/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go index 480b1015..74b2986d 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -59,7 +59,7 @@ type JWTTokenClaims struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go index 32062949..b2d1cd4a 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -31,7 +31,7 @@ type WebhookAuthenticatorSpec struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go index c0425a79..17e8a5eb 100644 --- a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -69,7 +69,7 @@ type CredentialIssuerStrategy struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped +// +kubebuilder:resource:categories=pinniped,scope=Cluster type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..59facfd0 100644 --- a/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: JWTAuthenticatorList plural: jwtauthenticators singular: jwtauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.issuer diff --git a/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index d31bae12..a23e8fcf 100644 --- a/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: WebhookAuthenticatorList plural: webhookauthenticators singular: webhookauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.endpoint diff --git a/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 9b4c0056..87a454a7 100644 --- a/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -16,7 +16,7 @@ spec: listKind: CredentialIssuerList plural: credentialissuers singular: credentialissuer - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: diff --git a/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go index 480b1015..74b2986d 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -59,7 +59,7 @@ type JWTTokenClaims struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go index 32062949..b2d1cd4a 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -31,7 +31,7 @@ type WebhookAuthenticatorSpec struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators +// +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` diff --git a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go index c0425a79..17e8a5eb 100644 --- a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -69,7 +69,7 @@ type CredentialIssuerStrategy struct { // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:categories=pinniped +// +kubebuilder:resource:categories=pinniped,scope=Cluster type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..59facfd0 100644 --- a/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: JWTAuthenticatorList plural: jwtauthenticators singular: jwtauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.issuer diff --git a/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index d31bae12..a23e8fcf 100644 --- a/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -18,7 +18,7 @@ spec: listKind: WebhookAuthenticatorList plural: webhookauthenticators singular: webhookauthenticator - scope: Namespaced + scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.endpoint diff --git a/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 9b4c0056..87a454a7 100644 --- a/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -16,7 +16,7 @@ spec: listKind: CredentialIssuerList plural: credentialissuers singular: credentialissuer - scope: Namespaced + scope: Cluster versions: - name: v1alpha1 schema: From 2eb01bd3072d6ed4ccd652dadf373ad8e03ebf24 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Tue, 9 Feb 2021 18:16:22 -0500 Subject: [PATCH 06/15] authncache: remove namespace concept Signed-off-by: Monis Khan --- .../authenticator/authncache/cache.go | 15 ++--- .../authenticator/authncache/cache_test.go | 20 +++--- .../cachecleaner/cachecleaner.go | 16 ++--- .../cachecleaner/cachecleaner_test.go | 66 ++++++++----------- .../jwtcachefiller/jwtcachefiller.go | 7 +- .../jwtcachefiller/jwtcachefiller_test.go | 7 +- .../webhookcachefiller/webhookcachefiller.go | 7 +- 7 files changed, 57 insertions(+), 81 deletions(-) diff --git a/internal/controller/authenticator/authncache/cache.go b/internal/controller/authenticator/authncache/cache.go index 2816d27c..24269cff 100644 --- a/internal/controller/authenticator/authncache/cache.go +++ b/internal/controller/authenticator/authncache/cache.go @@ -28,10 +28,9 @@ type Cache struct { } type Key struct { - APIGroup string - Kind string - Namespace string - Name string + APIGroup string + Kind string + Name string } type Value interface { @@ -74,7 +73,6 @@ func (c *Cache) Keys() []Key { sort.Slice(result, func(i, j int) bool { return result[i].APIGroup < result[j].APIGroup || result[i].Kind < result[j].Kind || - result[i].Namespace < result[j].Namespace || result[i].Name < result[j].Name }) return result @@ -83,9 +81,8 @@ func (c *Cache) Keys() []Key { func (c *Cache) AuthenticateTokenCredentialRequest(ctx context.Context, req *loginapi.TokenCredentialRequest) (user.Info, error) { // Map the incoming request to a cache key. key := Key{ - Namespace: req.Namespace, - Name: req.Spec.Authenticator.Name, - Kind: req.Spec.Authenticator.Kind, + Name: req.Spec.Authenticator.Name, + Kind: req.Spec.Authenticator.Kind, } if req.Spec.Authenticator.APIGroup != nil { key.APIGroup = *req.Spec.Authenticator.APIGroup @@ -95,7 +92,7 @@ func (c *Cache) AuthenticateTokenCredentialRequest(ctx context.Context, req *log if val == nil { plog.Debug( "authenticator does not exist", - "authenticator", klog.KRef(key.Namespace, key.Name), + "authenticator", klog.KRef("", key.Name), "kind", key.Kind, "apiGroup", key.APIGroup, ) diff --git a/internal/controller/authenticator/authncache/cache_test.go b/internal/controller/authenticator/authncache/cache_test.go index d48a1951..df383b31 100644 --- a/internal/controller/authenticator/authncache/cache_test.go +++ b/internal/controller/authenticator/authncache/cache_test.go @@ -31,13 +31,13 @@ func TestCache(t *testing.T) { cache := New() require.NotNil(t, cache) - key1 := Key{Namespace: "foo", Name: "authenticator-one"} + key1 := Key{Name: "authenticator-one"} mockToken1 := mocktokenauthenticator.NewMockToken(ctrl) cache.Store(key1, mockToken1) require.Equal(t, mockToken1, cache.Get(key1)) require.Equal(t, 1, len(cache.Keys())) - key2 := Key{Namespace: "foo", Name: "authenticator-two"} + key2 := Key{Name: "authenticator-two"} mockToken2 := mocktokenauthenticator.NewMockToken(ctrl) cache.Store(key2, mockToken2) require.Equal(t, mockToken2, cache.Get(key2)) @@ -50,11 +50,10 @@ func TestCache(t *testing.T) { // Fill the cache back up with a fixed set of keys, but inserted in shuffled order. keysInExpectedOrder := []Key{ - {APIGroup: "a", Kind: "a", Namespace: "a", Name: "a"}, - {APIGroup: "b", Kind: "a", Namespace: "a", Name: "a"}, - {APIGroup: "b", Kind: "b", Namespace: "a", Name: "a"}, - {APIGroup: "b", Kind: "b", Namespace: "b", Name: "a"}, - {APIGroup: "b", Kind: "b", Namespace: "b", Name: "b"}, + {APIGroup: "a", Kind: "a", Name: "a"}, + {APIGroup: "b", Kind: "a", Name: "a"}, + {APIGroup: "b", Kind: "b", Name: "a"}, + {APIGroup: "b", Kind: "b", Name: "b"}, } for tries := 0; tries < 10; tries++ { cache := New() @@ -85,10 +84,9 @@ func TestAuthenticateTokenCredentialRequest(t *testing.T) { Status: loginapi.TokenCredentialRequestStatus{}, } validRequestKey := Key{ - APIGroup: *validRequest.Spec.Authenticator.APIGroup, - Kind: validRequest.Spec.Authenticator.Kind, - Namespace: validRequest.Namespace, - Name: validRequest.Spec.Authenticator.Name, + APIGroup: *validRequest.Spec.Authenticator.APIGroup, + Kind: validRequest.Spec.Authenticator.Kind, + Name: validRequest.Spec.Authenticator.Name, } mockCache := func(t *testing.T, res *authenticator.Response, authenticated bool, err error) *Cache { diff --git a/internal/controller/authenticator/cachecleaner/cachecleaner.go b/internal/controller/authenticator/cachecleaner/cachecleaner.go index d618e40e..348b2ed7 100644 --- a/internal/controller/authenticator/cachecleaner/cachecleaner.go +++ b/internal/controller/authenticator/cachecleaner/cachecleaner.go @@ -72,19 +72,17 @@ func (c *controller) Sync(_ controllerlib.Context) error { authenticatorSet := map[authncache.Key]bool{} for _, webhook := range webhooks { key := authncache.Key{ - Namespace: webhook.Namespace, - Name: webhook.Name, - Kind: "WebhookAuthenticator", - APIGroup: auth1alpha1.SchemeGroupVersion.Group, + Name: webhook.Name, + Kind: "WebhookAuthenticator", + APIGroup: auth1alpha1.SchemeGroupVersion.Group, } authenticatorSet[key] = true } for _, jwtAuthenticator := range jwtAuthenticators { key := authncache.Key{ - Namespace: jwtAuthenticator.Namespace, - Name: jwtAuthenticator.Name, - Kind: "JWTAuthenticator", - APIGroup: auth1alpha1.SchemeGroupVersion.Group, + Name: jwtAuthenticator.Name, + Kind: "JWTAuthenticator", + APIGroup: auth1alpha1.SchemeGroupVersion.Group, } authenticatorSet[key] = true } @@ -97,7 +95,7 @@ func (c *controller) Sync(_ controllerlib.Context) error { if _, exists := authenticatorSet[key]; !exists { c.log.WithValues( "authenticator", - klog.KRef(key.Namespace, key.Name), + klog.KRef("", key.Name), "kind", key.Kind, ).Info("deleting authenticator from cache") diff --git a/internal/controller/authenticator/cachecleaner/cachecleaner_test.go b/internal/controller/authenticator/cachecleaner/cachecleaner_test.go index a735900b..72b42745 100644 --- a/internal/controller/authenticator/cachecleaner/cachecleaner_test.go +++ b/internal/controller/authenticator/cachecleaner/cachecleaner_test.go @@ -26,34 +26,29 @@ func TestController(t *testing.T) { t.Parallel() testWebhookKey1 := authncache.Key{ - APIGroup: "authentication.concierge.pinniped.dev", - Kind: "WebhookAuthenticator", - Namespace: "test-namespace", - Name: "test-webhook-name-one", + APIGroup: "authentication.concierge.pinniped.dev", + Kind: "WebhookAuthenticator", + Name: "test-webhook-name-one", } testWebhookKey2 := authncache.Key{ - APIGroup: "authentication.concierge.pinniped.dev", - Kind: "WebhookAuthenticator", - Namespace: "test-namespace", - Name: "test-webhook-name-two", + APIGroup: "authentication.concierge.pinniped.dev", + Kind: "WebhookAuthenticator", + Name: "test-webhook-name-two", } testJWTAuthenticatorKey1 := authncache.Key{ - APIGroup: "authentication.concierge.pinniped.dev", - Kind: "JWTAuthenticator", - Namespace: "test-namespace", - Name: "test-jwt-authenticator-name-one", + APIGroup: "authentication.concierge.pinniped.dev", + Kind: "JWTAuthenticator", + Name: "test-jwt-authenticator-name-one", } testJWTAuthenticatorKey2 := authncache.Key{ - APIGroup: "authentication.concierge.pinniped.dev", - Kind: "JWTAuthenticator", - Namespace: "test-namespace", - Name: "test-jwt-authenticator-name-two", + APIGroup: "authentication.concierge.pinniped.dev", + Kind: "JWTAuthenticator", + Name: "test-jwt-authenticator-name-two", } testKeyUnknownType := authncache.Key{ - APIGroup: "authentication.concierge.pinniped.dev", - Kind: "SomeOtherAuthenticator", - Namespace: "test-namespace", - Name: "test-name-one", + APIGroup: "authentication.concierge.pinniped.dev", + Kind: "SomeOtherAuthenticator", + Name: "test-name-one", } tests := []struct { @@ -73,14 +68,12 @@ func TestController(t *testing.T) { objects: []runtime.Object{ &authv1alpha.WebhookAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testWebhookKey1.Namespace, - Name: testWebhookKey1.Name, + Name: testWebhookKey1.Name, }, }, &authv1alpha.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testJWTAuthenticatorKey1.Namespace, - Name: testJWTAuthenticatorKey1.Name, + Name: testJWTAuthenticatorKey1.Name, }, }, }, @@ -91,26 +84,22 @@ func TestController(t *testing.T) { objects: []runtime.Object{ &authv1alpha.WebhookAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testWebhookKey1.Namespace, - Name: testWebhookKey1.Name, + Name: testWebhookKey1.Name, }, }, &authv1alpha.WebhookAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testWebhookKey2.Namespace, - Name: testWebhookKey2.Name, + Name: testWebhookKey2.Name, }, }, &authv1alpha.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testJWTAuthenticatorKey1.Namespace, - Name: testJWTAuthenticatorKey1.Name, + Name: testJWTAuthenticatorKey1.Name, }, }, &authv1alpha.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testJWTAuthenticatorKey2.Namespace, - Name: testJWTAuthenticatorKey2.Name, + Name: testJWTAuthenticatorKey2.Name, }, }, }, @@ -128,20 +117,18 @@ func TestController(t *testing.T) { objects: []runtime.Object{ &authv1alpha.WebhookAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testWebhookKey1.Namespace, - Name: testWebhookKey1.Name, + Name: testWebhookKey1.Name, }, }, &authv1alpha.JWTAuthenticator{ ObjectMeta: metav1.ObjectMeta{ - Namespace: testJWTAuthenticatorKey1.Namespace, - Name: testJWTAuthenticatorKey1.Name, + Name: testJWTAuthenticatorKey1.Name, }, }, }, wantLogs: []string{ - `cachecleaner-controller "level"=0 "msg"="deleting authenticator from cache" "authenticator"={"name":"test-jwt-authenticator-name-two","namespace":"test-namespace"} "kind"="JWTAuthenticator"`, - `cachecleaner-controller "level"=0 "msg"="deleting authenticator from cache" "authenticator"={"name":"test-webhook-name-two","namespace":"test-namespace"} "kind"="WebhookAuthenticator"`, + `cachecleaner-controller "level"=0 "msg"="deleting authenticator from cache" "authenticator"={"name":"test-jwt-authenticator-name-two"} "kind"="JWTAuthenticator"`, + `cachecleaner-controller "level"=0 "msg"="deleting authenticator from cache" "authenticator"={"name":"test-webhook-name-two"} "kind"="WebhookAuthenticator"`, }, wantCacheKeys: []authncache.Key{testWebhookKey1, testJWTAuthenticatorKey1, testKeyUnknownType}, }, @@ -173,8 +160,7 @@ func TestController(t *testing.T) { syncCtx := controllerlib.Context{ Context: ctx, Key: controllerlib.Key{ - Namespace: "test-namespace", - Name: "test-webhook-name-one", + Name: "test-webhook-name-one", }, } diff --git a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go index 4c54a37a..edbaca85 100644 --- a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go +++ b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller.go @@ -98,10 +98,9 @@ func (c *controller) Sync(ctx controllerlib.Context) error { } cacheKey := authncache.Key{ - APIGroup: auth1alpha1.GroupName, - Kind: "JWTAuthenticator", - Namespace: ctx.Key.Namespace, - Name: ctx.Key.Name, + APIGroup: auth1alpha1.GroupName, + Kind: "JWTAuthenticator", + Name: ctx.Key.Name, } // If this authenticator already exists, then only recreate it if is different from the desired diff --git a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go index cd66fdcb..9d3c342f 100644 --- a/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go +++ b/internal/controller/authenticator/jwtcachefiller/jwtcachefiller_test.go @@ -356,10 +356,9 @@ func TestController(t *testing.T) { // We expected the cache to have an entry, so pull that entry from the cache and test it. expectedCacheKey := authncache.Key{ - APIGroup: auth1alpha1.GroupName, - Kind: "JWTAuthenticator", - Namespace: syncCtx.Key.Namespace, - Name: syncCtx.Key.Name, + APIGroup: auth1alpha1.GroupName, + Kind: "JWTAuthenticator", + Name: syncCtx.Key.Name, } cachedAuthenticator := cache.Get(expectedCacheKey) require.NotNil(t, cachedAuthenticator) diff --git a/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go b/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go index 275f6859..732f1a89 100644 --- a/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go +++ b/internal/controller/authenticator/webhookcachefiller/webhookcachefiller.go @@ -69,10 +69,9 @@ func (c *controller) Sync(ctx controllerlib.Context) error { } c.cache.Store(authncache.Key{ - APIGroup: auth1alpha1.GroupName, - Kind: "WebhookAuthenticator", - Namespace: ctx.Key.Namespace, - Name: ctx.Key.Name, + APIGroup: auth1alpha1.GroupName, + Kind: "WebhookAuthenticator", + Name: ctx.Key.Name, }, webhookAuthenticator) c.log.WithValues("webhook", klog.KObj(obj), "endpoint", obj.Spec.Endpoint).Info("added new webhook authenticator") return nil From ac011864994da4a49e28eaaa9cf8e2b5682cd165 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 11:12:03 -0500 Subject: [PATCH 07/15] Use API service as owner ref for cluster scoped resources Signed-off-by: Monis Khan --- internal/apiserviceref/apiserviceref.go | 36 ++++++++++ .../controllermanager/prepare_controllers.go | 21 ++++-- internal/deploymentref/deploymentref.go | 2 +- .../concierge_credentialissuerconfig_test.go | 19 +++++ test/integration/kubeclient_test.go | 69 +++++++++++++++---- 5 files changed, 124 insertions(+), 23 deletions(-) create mode 100644 internal/apiserviceref/apiserviceref.go diff --git a/internal/apiserviceref/apiserviceref.go b/internal/apiserviceref/apiserviceref.go new file mode 100644 index 00000000..b50b1d33 --- /dev/null +++ b/internal/apiserviceref/apiserviceref.go @@ -0,0 +1,36 @@ +// Copyright 2021 the Pinniped contributors. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package apiserviceref + +import ( + "context" + "fmt" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" + + "go.pinniped.dev/internal/kubeclient" + "go.pinniped.dev/internal/ownerref" +) + +func New(apiServiceName string, opts ...kubeclient.Option) (kubeclient.Option, error) { + tempClient, err := kubeclient.New(opts...) + if err != nil { + return nil, fmt.Errorf("cannot create temp client: %w", err) + } + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + apiService, err := tempClient.Aggregation.ApiregistrationV1().APIServices().Get(ctx, apiServiceName, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("cannot get api service %s: %w", apiServiceName, err) + } + + // work around stupid behavior of WithoutVersionDecoder.Decode + apiService.APIVersion, apiService.Kind = apiregistrationv1.SchemeGroupVersion.WithKind("APIService").ToAPIVersionAndKind() + + return kubeclient.WithMiddleware(ownerref.New(apiService)), nil +} diff --git a/internal/controllermanager/prepare_controllers.go b/internal/controllermanager/prepare_controllers.go index 6e3e0b75..5f6c6d16 100644 --- a/internal/controllermanager/prepare_controllers.go +++ b/internal/controllermanager/prepare_controllers.go @@ -18,6 +18,7 @@ import ( loginv1alpha1 "go.pinniped.dev/generated/1.20/apis/concierge/login/v1alpha1" pinnipedclientset "go.pinniped.dev/generated/1.20/client/concierge/clientset/versioned" pinnipedinformers "go.pinniped.dev/generated/1.20/client/concierge/informers/externalversions" + "go.pinniped.dev/internal/apiserviceref" "go.pinniped.dev/internal/config/concierge" "go.pinniped.dev/internal/controller/apicerts" "go.pinniped.dev/internal/controller/authenticator/authncache" @@ -84,13 +85,25 @@ type Config struct { // Prepare the controllers and their informers and return a function that will start them when called. //nolint:funlen // Eh, fair, it is a really long function...but it is wiring the world...so... func PrepareControllers(c *Config) (func(ctx context.Context), error) { + groupName, ok := groupsuffix.Replace(loginv1alpha1.GroupName, c.APIGroupSuffix) + if !ok { + return nil, fmt.Errorf("cannot make api group from %s/%s", loginv1alpha1.GroupName, c.APIGroupSuffix) + } + apiServiceName := loginv1alpha1.SchemeGroupVersion.Version + "." + groupName + dref, _, err := deploymentref.New(c.ServerInstallationInfo) if err != nil { return nil, fmt.Errorf("cannot create deployment ref: %w", err) } + apiServiceRef, err := apiserviceref.New(apiServiceName) + if err != nil { + return nil, fmt.Errorf("cannot create API service ref: %w", err) + } + client, err := kubeclient.New( - dref, + dref, // first try to use the deployment as an owner ref (for namespace scoped resources) + apiServiceRef, // fallback to our API service (for everything else we create) kubeclient.WithMiddleware(groupsuffix.New(c.APIGroupSuffix)), ) if err != nil { @@ -112,12 +125,6 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { Name: c.NamesConfig.CredentialIssuer, } - groupName, ok := groupsuffix.Replace(loginv1alpha1.GroupName, c.APIGroupSuffix) - if !ok { - return nil, fmt.Errorf("cannot make api group from %s/%s", loginv1alpha1.GroupName, c.APIGroupSuffix) - } - apiServiceName := loginv1alpha1.SchemeGroupVersion.Version + "." + groupName - // Create controller manager. controllerManager := controllerlib. NewManager(). diff --git a/internal/deploymentref/deploymentref.go b/internal/deploymentref/deploymentref.go index b5fa2c9f..0c550a04 100644 --- a/internal/deploymentref/deploymentref.go +++ b/internal/deploymentref/deploymentref.go @@ -19,7 +19,7 @@ import ( // getTempClient is stubbed out for testing. // -// We would normally inject a kubernetes.Interface into New(), but the client we want to create in +// We would normally pass a kubernetes.Interface into New(), but the client we want to create in // the calling code depends on the return value of New() (i.e., on the kubeclient.Option for the // OwnerReference). //nolint: gochecknoglobals diff --git a/test/integration/concierge_credentialissuerconfig_test.go b/test/integration/concierge_credentialissuerconfig_test.go index 583a0250..4f241d5b 100644 --- a/test/integration/concierge_credentialissuerconfig_test.go +++ b/test/integration/concierge_credentialissuerconfig_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" configv1alpha1 "go.pinniped.dev/generated/1.20/apis/concierge/config/v1alpha1" "go.pinniped.dev/test/library" @@ -20,6 +21,7 @@ func TestCredentialIssuer(t *testing.T) { env := library.IntegrationEnv(t) config := library.NewClientConfig(t) client := library.NewConciergeClientset(t) + aggregatedClientset := library.NewAggregatedClientset(t) library.AssertNoRestartsDuringTest(t, env.ConciergeNamespace, "") @@ -43,6 +45,23 @@ func TestCredentialIssuer(t *testing.T) { } require.Equal(t, env.ConciergeAppName, actualConfig.Labels["app"]) + // verify owner ref is set + require.Len(t, actualConfig.OwnerReferences, 1) + + apiService, err := aggregatedClientset.ApiregistrationV1().APIServices().Get(ctx, "v1alpha1.login.concierge."+env.APIGroupSuffix, metav1.GetOptions{}) + require.NoError(t, err) + + // work around stupid behavior of WithoutVersionDecoder.Decode + apiService.APIVersion, apiService.Kind = apiregistrationv1.SchemeGroupVersion.WithKind("APIService").ToAPIVersionAndKind() + + ref := metav1.OwnerReference{ + APIVersion: apiService.APIVersion, + Kind: apiService.Kind, + Name: apiService.Name, + UID: apiService.UID, + } + require.Equal(t, ref, actualConfig.OwnerReferences[0]) + // Verify the cluster strategy status based on what's expected of the test cluster's ability to share signing keys. actualStatusStrategies := actualConfigList.Items[0].Status.Strategies require.Len(t, actualStatusStrategies, 1) diff --git a/test/integration/kubeclient_test.go b/test/integration/kubeclient_test.go index c8580e14..0448c4f6 100644 --- a/test/integration/kubeclient_test.go +++ b/test/integration/kubeclient_test.go @@ -17,6 +17,7 @@ import ( conciergeconfigv1alpha1 "go.pinniped.dev/generated/1.20/apis/concierge/config/v1alpha1" supervisorconfigv1alpha1 "go.pinniped.dev/generated/1.20/apis/supervisor/config/v1alpha1" + "go.pinniped.dev/internal/apiserviceref" "go.pinniped.dev/internal/groupsuffix" "go.pinniped.dev/internal/kubeclient" "go.pinniped.dev/internal/ownerref" @@ -27,6 +28,7 @@ func TestKubeClientOwnerRef(t *testing.T) { env := library.IntegrationEnv(t) regularClient := library.NewKubernetesClientset(t) + regularAggregationClient := library.NewAggregatedClientset(t) ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -73,9 +75,47 @@ func TestKubeClientOwnerRef(t *testing.T) { UID: parentSecret.UID, } + parentAPIService, err := regularAggregationClient.ApiregistrationV1().APIServices().Create( + ctx, + &apiregistrationv1.APIService{ + ObjectMeta: metav1.ObjectMeta{ + Name: "v1.snorlax.dev", + }, + Spec: apiregistrationv1.APIServiceSpec{ + Version: "v1", + Group: "snorlax.dev", + GroupPriorityMinimum: 10_000, + VersionPriority: 500, + }, + }, + metav1.CreateOptions{}, + ) + require.NoError(t, err) + defer func() { + err := regularAggregationClient.ApiregistrationV1().APIServices().Delete(ctx, parentAPIService.Name, metav1.DeleteOptions{}) + if errors.IsNotFound(err) { + return + } + require.NoError(t, err) + }() + + // work around stupid behavior of WithoutVersionDecoder.Decode + parentAPIService.APIVersion, parentAPIService.Kind = apiregistrationv1.SchemeGroupVersion.WithKind("APIService").ToAPIVersionAndKind() + + parentAPIServiceRef := metav1.OwnerReference{ + APIVersion: parentAPIService.APIVersion, + Kind: parentAPIService.Kind, + Name: parentAPIService.Name, + UID: parentAPIService.UID, + } + + apiServiceRef, err := apiserviceref.New(parentAPIService.Name, kubeclient.WithConfig(library.NewClientConfig(t))) + require.NoError(t, err) + // create a client that should set an owner ref back to parent on create ownerRefClient, err := kubeclient.New( - kubeclient.WithMiddleware(ownerref.New(parentSecret)), + kubeclient.WithMiddleware(ownerref.New(parentSecret)), // secret owner ref first when possible + apiServiceRef, // api service for everything else kubeclient.WithMiddleware(groupsuffix.New(env.APIGroupSuffix)), kubeclient.WithConfig(library.NewClientConfig(t)), ) @@ -132,7 +172,7 @@ func TestKubeClientOwnerRef(t *testing.T) { require.NotEqual(t, parentSecret.ResourceVersion, updatedParentSecret.ResourceVersion) require.Len(t, updatedParentSecret.OwnerReferences, 0) - // delete the parent object + // delete the parent secret object err = ownerRefSecrets.Delete(ctx, parentSecret.Name, metav1.DeleteOptions{}) require.NoError(t, err) @@ -142,9 +182,7 @@ func TestKubeClientOwnerRef(t *testing.T) { return err }) - // sanity check API service client - the middleware code shouldn't add an owner reference to this - // APIService because the APIService is cluster-scoped and the parent object is namespace-scoped, - // which is invalid in Kubernetes + // cluster scoped API service should be owned by the other one we created above apiService, err := ownerRefClient.Aggregation.ApiregistrationV1().APIServices().Create( ctx, &apiregistrationv1.APIService{ @@ -162,10 +200,18 @@ func TestKubeClientOwnerRef(t *testing.T) { metav1.CreateOptions{}, ) require.NoError(t, err) - hasNoOwnerRef(t, apiService) - err = ownerRefClient.Aggregation.ApiregistrationV1().APIServices().Delete(ctx, apiService.Name, metav1.DeleteOptions{}) + hasOwnerRef(t, apiService, parentAPIServiceRef) + + // delete the parent API service object + err = ownerRefClient.Aggregation.ApiregistrationV1().APIServices().Delete(ctx, parentAPIService.Name, metav1.DeleteOptions{}) require.NoError(t, err) + // the child object should be cleaned up on its own + isEventuallyDeleted(t, func() error { + _, err := ownerRefClient.Aggregation.ApiregistrationV1().APIServices().Get(ctx, apiService.Name, metav1.GetOptions{}) + return err + }) + // sanity check concierge client credentialIssuer, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers().Create( ctx, @@ -181,7 +227,7 @@ func TestKubeClientOwnerRef(t *testing.T) { metav1.CreateOptions{}, ) require.NoError(t, err) - hasOwnerRef(t, credentialIssuer, ref) + hasOwnerRef(t, credentialIssuer, parentAPIServiceRef) // this owner has already been deleted so the cred issuer should be immediately deleted isEventuallyDeleted(t, func() error { _, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers().Get(ctx, credentialIssuer.Name, metav1.GetOptions{}) @@ -246,13 +292,6 @@ func hasOwnerRef(t *testing.T, obj metav1.Object, ref metav1.OwnerReference) { require.Equal(t, ref, ownerReferences[0]) } -func hasNoOwnerRef(t *testing.T, obj metav1.Object) { - t.Helper() - - ownerReferences := obj.GetOwnerReferences() - require.Len(t, ownerReferences, 0) -} - func isEventuallyDeleted(t *testing.T, f func() error) { t.Helper() From 2e9baf9fa67d2bb57285a1d1f0828ad943eeef19 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 17:42:08 -0500 Subject: [PATCH 08/15] Correctly generate status subresource for all CRDs Signed-off-by: Monis Khan --- apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl | 1 + apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl | 1 + apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl | 1 + apis/supervisor/config/v1alpha1/types_federationdomain.go.tmpl | 1 + 4 files changed, 4 insertions(+) diff --git a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl index 74b2986d..813460fa 100644 --- a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl @@ -61,6 +61,7 @@ type JWTTokenClaims struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` +// +kubebuilder:subresource:status type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl index b2d1cd4a..2bf626d2 100644 --- a/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl @@ -33,6 +33,7 @@ type WebhookAuthenticatorSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` +// +kubebuilder:subresource:status type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl index 17e8a5eb..ed2aaef7 100644 --- a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl +++ b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl @@ -70,6 +70,7 @@ type CredentialIssuerStrategy struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/apis/supervisor/config/v1alpha1/types_federationdomain.go.tmpl b/apis/supervisor/config/v1alpha1/types_federationdomain.go.tmpl index 2655ab56..ecea1073 100644 --- a/apis/supervisor/config/v1alpha1/types_federationdomain.go.tmpl +++ b/apis/supervisor/config/v1alpha1/types_federationdomain.go.tmpl @@ -109,6 +109,7 @@ type FederationDomainStatus struct { // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped +// +kubebuilder:subresource:status type FederationDomain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` From dd3d1c8b1b78555165ad3e10f6576bb1af54f1a7 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 17:49:21 -0500 Subject: [PATCH 09/15] Generated Signed-off-by: Monis Khan --- ...uthentication.concierge.pinniped.dev_jwtauthenticators.yaml | 3 ++- ...ntication.concierge.pinniped.dev_webhookauthenticators.yaml | 3 ++- .../config.concierge.pinniped.dev_credentialissuers.yaml | 2 ++ .../config.supervisor.pinniped.dev_federationdomains.yaml | 2 ++ .../1.17/apis/concierge/authentication/v1alpha1/types_jwt.go | 1 + .../apis/concierge/authentication/v1alpha1/types_webhook.go | 1 + .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../apis/supervisor/config/v1alpha1/types_federationdomain.go | 1 + ...uthentication.concierge.pinniped.dev_jwtauthenticators.yaml | 3 ++- ...ntication.concierge.pinniped.dev_webhookauthenticators.yaml | 3 ++- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 ++ .../crds/config.supervisor.pinniped.dev_federationdomains.yaml | 2 ++ .../1.18/apis/concierge/authentication/v1alpha1/types_jwt.go | 1 + .../apis/concierge/authentication/v1alpha1/types_webhook.go | 1 + .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../apis/supervisor/config/v1alpha1/types_federationdomain.go | 1 + ...uthentication.concierge.pinniped.dev_jwtauthenticators.yaml | 3 ++- ...ntication.concierge.pinniped.dev_webhookauthenticators.yaml | 3 ++- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 ++ .../crds/config.supervisor.pinniped.dev_federationdomains.yaml | 2 ++ .../1.19/apis/concierge/authentication/v1alpha1/types_jwt.go | 1 + .../apis/concierge/authentication/v1alpha1/types_webhook.go | 1 + .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../apis/supervisor/config/v1alpha1/types_federationdomain.go | 1 + ...uthentication.concierge.pinniped.dev_jwtauthenticators.yaml | 3 ++- ...ntication.concierge.pinniped.dev_webhookauthenticators.yaml | 3 ++- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 ++ .../crds/config.supervisor.pinniped.dev_federationdomains.yaml | 2 ++ .../1.20/apis/concierge/authentication/v1alpha1/types_jwt.go | 1 + .../apis/concierge/authentication/v1alpha1/types_webhook.go | 1 + .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../apis/supervisor/config/v1alpha1/types_federationdomain.go | 1 + ...uthentication.concierge.pinniped.dev_jwtauthenticators.yaml | 3 ++- ...ntication.concierge.pinniped.dev_webhookauthenticators.yaml | 3 ++- .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 ++ .../crds/config.supervisor.pinniped.dev_federationdomains.yaml | 2 ++ 36 files changed, 56 insertions(+), 10 deletions(-) diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index 59facfd0..9f5ec0fc 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -161,7 +161,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index a23e8fcf..3ccd3216 100644 --- a/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -137,7 +137,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml index 87a454a7..a59cca14 100644 --- a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml @@ -103,6 +103,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/deploy/supervisor/config.supervisor.pinniped.dev_federationdomains.yaml b/deploy/supervisor/config.supervisor.pinniped.dev_federationdomains.yaml index d894643b..2b4af346 100644 --- a/deploy/supervisor/config.supervisor.pinniped.dev_federationdomains.yaml +++ b/deploy/supervisor/config.supervisor.pinniped.dev_federationdomains.yaml @@ -150,6 +150,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go index 74b2986d..813460fa 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -61,6 +61,7 @@ type JWTTokenClaims struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` +// +kubebuilder:subresource:status type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go index b2d1cd4a..2bf626d2 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -33,6 +33,7 @@ type WebhookAuthenticatorSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` +// +kubebuilder:subresource:status type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go index 17e8a5eb..ed2aaef7 100644 --- a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -70,6 +70,7 @@ type CredentialIssuerStrategy struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.17/apis/supervisor/config/v1alpha1/types_federationdomain.go b/generated/1.17/apis/supervisor/config/v1alpha1/types_federationdomain.go index 2655ab56..ecea1073 100644 --- a/generated/1.17/apis/supervisor/config/v1alpha1/types_federationdomain.go +++ b/generated/1.17/apis/supervisor/config/v1alpha1/types_federationdomain.go @@ -109,6 +109,7 @@ type FederationDomainStatus struct { // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped +// +kubebuilder:subresource:status type FederationDomain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index 59facfd0..9f5ec0fc 100644 --- a/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -161,7 +161,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index a23e8fcf..3ccd3216 100644 --- a/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.17/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -137,7 +137,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 87a454a7..a59cca14 100644 --- a/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -103,6 +103,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.17/crds/config.supervisor.pinniped.dev_federationdomains.yaml b/generated/1.17/crds/config.supervisor.pinniped.dev_federationdomains.yaml index d894643b..2b4af346 100644 --- a/generated/1.17/crds/config.supervisor.pinniped.dev_federationdomains.yaml +++ b/generated/1.17/crds/config.supervisor.pinniped.dev_federationdomains.yaml @@ -150,6 +150,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go index 74b2986d..813460fa 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -61,6 +61,7 @@ type JWTTokenClaims struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` +// +kubebuilder:subresource:status type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go index b2d1cd4a..2bf626d2 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -33,6 +33,7 @@ type WebhookAuthenticatorSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` +// +kubebuilder:subresource:status type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go index 17e8a5eb..ed2aaef7 100644 --- a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -70,6 +70,7 @@ type CredentialIssuerStrategy struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.18/apis/supervisor/config/v1alpha1/types_federationdomain.go b/generated/1.18/apis/supervisor/config/v1alpha1/types_federationdomain.go index 2655ab56..ecea1073 100644 --- a/generated/1.18/apis/supervisor/config/v1alpha1/types_federationdomain.go +++ b/generated/1.18/apis/supervisor/config/v1alpha1/types_federationdomain.go @@ -109,6 +109,7 @@ type FederationDomainStatus struct { // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped +// +kubebuilder:subresource:status type FederationDomain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index 59facfd0..9f5ec0fc 100644 --- a/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -161,7 +161,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index a23e8fcf..3ccd3216 100644 --- a/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.18/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -137,7 +137,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 87a454a7..a59cca14 100644 --- a/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -103,6 +103,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.18/crds/config.supervisor.pinniped.dev_federationdomains.yaml b/generated/1.18/crds/config.supervisor.pinniped.dev_federationdomains.yaml index d894643b..2b4af346 100644 --- a/generated/1.18/crds/config.supervisor.pinniped.dev_federationdomains.yaml +++ b/generated/1.18/crds/config.supervisor.pinniped.dev_federationdomains.yaml @@ -150,6 +150,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go index 74b2986d..813460fa 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -61,6 +61,7 @@ type JWTTokenClaims struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` +// +kubebuilder:subresource:status type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go index b2d1cd4a..2bf626d2 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -33,6 +33,7 @@ type WebhookAuthenticatorSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` +// +kubebuilder:subresource:status type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go index 17e8a5eb..ed2aaef7 100644 --- a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -70,6 +70,7 @@ type CredentialIssuerStrategy struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.19/apis/supervisor/config/v1alpha1/types_federationdomain.go b/generated/1.19/apis/supervisor/config/v1alpha1/types_federationdomain.go index 2655ab56..ecea1073 100644 --- a/generated/1.19/apis/supervisor/config/v1alpha1/types_federationdomain.go +++ b/generated/1.19/apis/supervisor/config/v1alpha1/types_federationdomain.go @@ -109,6 +109,7 @@ type FederationDomainStatus struct { // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped +// +kubebuilder:subresource:status type FederationDomain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index 59facfd0..9f5ec0fc 100644 --- a/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -161,7 +161,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index a23e8fcf..3ccd3216 100644 --- a/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.19/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -137,7 +137,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 87a454a7..a59cca14 100644 --- a/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -103,6 +103,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.19/crds/config.supervisor.pinniped.dev_federationdomains.yaml b/generated/1.19/crds/config.supervisor.pinniped.dev_federationdomains.yaml index d894643b..2b4af346 100644 --- a/generated/1.19/crds/config.supervisor.pinniped.dev_federationdomains.yaml +++ b/generated/1.19/crds/config.supervisor.pinniped.dev_federationdomains.yaml @@ -150,6 +150,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go b/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go index 74b2986d..813460fa 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -61,6 +61,7 @@ type JWTTokenClaims struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuer` +// +kubebuilder:subresource:status type JWTAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go b/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go index b2d1cd4a..2bf626d2 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -33,6 +33,7 @@ type WebhookAuthenticatorSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped;pinniped-authenticator;pinniped-authenticators,scope=Cluster // +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint` +// +kubebuilder:subresource:status type WebhookAuthenticator struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go index 17e8a5eb..ed2aaef7 100644 --- a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -70,6 +70,7 @@ type CredentialIssuerStrategy struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.20/apis/supervisor/config/v1alpha1/types_federationdomain.go b/generated/1.20/apis/supervisor/config/v1alpha1/types_federationdomain.go index 2655ab56..ecea1073 100644 --- a/generated/1.20/apis/supervisor/config/v1alpha1/types_federationdomain.go +++ b/generated/1.20/apis/supervisor/config/v1alpha1/types_federationdomain.go @@ -109,6 +109,7 @@ type FederationDomainStatus struct { // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=pinniped +// +kubebuilder:subresource:status type FederationDomain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index 59facfd0..9f5ec0fc 100644 --- a/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml +++ b/generated/1.20/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml @@ -161,7 +161,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml b/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml index a23e8fcf..3ccd3216 100644 --- a/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml +++ b/generated/1.20/crds/authentication.concierge.pinniped.dev_webhookauthenticators.yaml @@ -137,7 +137,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml index 87a454a7..a59cca14 100644 --- a/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -103,6 +103,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/generated/1.20/crds/config.supervisor.pinniped.dev_federationdomains.yaml b/generated/1.20/crds/config.supervisor.pinniped.dev_federationdomains.yaml index d894643b..2b4af346 100644 --- a/generated/1.20/crds/config.supervisor.pinniped.dev_federationdomains.yaml +++ b/generated/1.20/crds/config.supervisor.pinniped.dev_federationdomains.yaml @@ -150,6 +150,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" From de88ae2f61ccb0f8b2abe15bd6436ae54078963e Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 18:02:18 -0500 Subject: [PATCH 10/15] Fix status related RBAC Signed-off-by: Monis Khan --- deploy/concierge/rbac.yaml | 8 ++++++-- deploy/supervisor/rbac.yaml | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/deploy/concierge/rbac.yaml b/deploy/concierge/rbac.yaml index a54c94a2..e74ae281 100644 --- a/deploy/concierge/rbac.yaml +++ b/deploy/concierge/rbac.yaml @@ -17,7 +17,7 @@ rules: verbs: [ get, list, watch ] - apiGroups: [ apiregistration.k8s.io ] resources: [ apiservices ] - verbs: [ create, get, list, patch, update, watch ] + verbs: [ get, list, patch, update, watch ] - apiGroups: [ admissionregistration.k8s.io ] resources: [ validatingwebhookconfigurations, mutatingwebhookconfigurations ] verbs: [ get, list, watch ] @@ -34,7 +34,11 @@ rules: - apiGroups: - #@ pinnipedDevAPIGroupWithPrefix("config.concierge") resources: [ credentialissuers ] - verbs: [ get, list, watch, create, update ] + verbs: [ get, list, watch, create ] + - apiGroups: + - #@ pinnipedDevAPIGroupWithPrefix("config.concierge") + resources: [ credentialissuers/status ] + verbs: [get, patch, update] - apiGroups: - #@ pinnipedDevAPIGroupWithPrefix("authentication.concierge") resources: [ jwtauthenticators, webhookauthenticators ] diff --git a/deploy/supervisor/rbac.yaml b/deploy/supervisor/rbac.yaml index ea7f4e65..cb84f342 100644 --- a/deploy/supervisor/rbac.yaml +++ b/deploy/supervisor/rbac.yaml @@ -19,7 +19,11 @@ rules: - apiGroups: - #@ pinnipedDevAPIGroupWithPrefix("config.supervisor") resources: [federationdomains] - verbs: [update, get, list, watch] + verbs: [get, list, watch] + - apiGroups: + - #@ pinnipedDevAPIGroupWithPrefix("config.supervisor") + resources: [federationdomains/status] + verbs: [get, patch, update] - apiGroups: - #@ pinnipedDevAPIGroupWithPrefix("idp.supervisor") resources: [oidcidentityproviders] From 4faf724c2c5fa380ef18b4bcd97e4d18510888df Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 20:02:36 -0500 Subject: [PATCH 11/15] Make credential issuer status optional Signed-off-by: Monis Khan --- apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl index ed2aaef7..63d59446 100644 --- a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl +++ b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl @@ -76,6 +76,7 @@ type CredentialIssuer struct { metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } From 96cec59236ad8303cf503ff6cdb65239d6050359 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 20:03:15 -0500 Subject: [PATCH 12/15] Generated Signed-off-by: Monis Khan --- .../config.concierge.pinniped.dev_credentialissuers.yaml | 2 -- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 -- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 -- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 -- .../apis/concierge/config/v1alpha1/types_credentialissuer.go | 1 + .../crds/config.concierge.pinniped.dev_credentialissuers.yaml | 2 -- 9 files changed, 4 insertions(+), 10 deletions(-) diff --git a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml index a59cca14..900db6cb 100644 --- a/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/deploy/concierge/config.concierge.pinniped.dev_credentialissuers.yaml @@ -98,8 +98,6 @@ spec: required: - strategies type: object - required: - - status type: object served: true storage: true diff --git a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go index ed2aaef7..63d59446 100644 --- a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -76,6 +76,7 @@ type CredentialIssuer struct { metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } diff --git a/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml index a59cca14..900db6cb 100644 --- a/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.17/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -98,8 +98,6 @@ spec: required: - strategies type: object - required: - - status type: object served: true storage: true diff --git a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go index ed2aaef7..63d59446 100644 --- a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -76,6 +76,7 @@ type CredentialIssuer struct { metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } diff --git a/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml index a59cca14..900db6cb 100644 --- a/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.18/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -98,8 +98,6 @@ spec: required: - strategies type: object - required: - - status type: object served: true storage: true diff --git a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go index ed2aaef7..63d59446 100644 --- a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -76,6 +76,7 @@ type CredentialIssuer struct { metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } diff --git a/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml index a59cca14..900db6cb 100644 --- a/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.19/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -98,8 +98,6 @@ spec: required: - strategies type: object - required: - - status type: object served: true storage: true diff --git a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go index ed2aaef7..63d59446 100644 --- a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -76,6 +76,7 @@ type CredentialIssuer struct { metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } diff --git a/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml b/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml index a59cca14..900db6cb 100644 --- a/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml +++ b/generated/1.20/crds/config.concierge.pinniped.dev_credentialissuers.yaml @@ -98,8 +98,6 @@ spec: required: - strategies type: object - required: - - status type: object served: true storage: true From 0a9f4468935a577408f75d8a714ce449ce171471 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 20:59:46 -0500 Subject: [PATCH 13/15] Update credential issuer logic to use status subresource Signed-off-by: Monis Khan --- ...eate_or_update_credential_issuer_config.go | 45 ++++++------ ...or_update_credential_issuer_config_test.go | 68 +++++++++++-------- .../kube_config_info_publisher.go | 6 +- .../kube_config_info_publisher_test.go | 43 +++++++++--- .../kubecertagent/annotater_test.go | 16 ++++- .../controller/kubecertagent/creater_test.go | 40 ++++++++++- .../controller/kubecertagent/execer_test.go | 38 +++++++++-- .../controller/kubecertagent/kubecertagent.go | 6 +- test/integration/kubeclient_test.go | 3 - 9 files changed, 183 insertions(+), 82 deletions(-) diff --git a/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go b/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go index 859dc721..1aff2208 100644 --- a/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go +++ b/internal/controller/issuerconfig/create_or_update_credential_issuer_config.go @@ -17,12 +17,12 @@ import ( pinnipedclientset "go.pinniped.dev/generated/1.20/client/concierge/clientset/versioned" ) -func CreateOrUpdateCredentialIssuer( +func CreateOrUpdateCredentialIssuerStatus( ctx context.Context, credentialIssuerResourceName string, credentialIssuerLabels map[string]string, pinnipedClient pinnipedclientset.Interface, - applyUpdatesToCredentialIssuerFunc func(configToUpdate *configv1alpha1.CredentialIssuer), + applyUpdatesToCredentialIssuerFunc func(configToUpdate *configv1alpha1.CredentialIssuerStatus), ) error { err := retry.RetryOnConflict(retry.DefaultRetry, func() error { existingCredentialIssuer, err := pinnipedClient. @@ -38,29 +38,30 @@ func CreateOrUpdateCredentialIssuer( credentialIssuersClient := pinnipedClient.ConfigV1alpha1().CredentialIssuers() if notFound { - // Create it - credentialIssuer := minimalValidCredentialIssuer( - credentialIssuerResourceName, credentialIssuerLabels, - ) - applyUpdatesToCredentialIssuerFunc(credentialIssuer) + // create an empty credential issuer + minCredentialIssuer := minimalValidCredentialIssuer(credentialIssuerResourceName, credentialIssuerLabels) - if _, err := credentialIssuersClient.Create(ctx, credentialIssuer, metav1.CreateOptions{}); err != nil { + newCredentialIssuer, err := credentialIssuersClient.Create(ctx, minCredentialIssuer, metav1.CreateOptions{}) + if err != nil { return fmt.Errorf("create failed: %w", err) } - } else { - // Already exists, so check to see if we need to update it - credentialIssuer := existingCredentialIssuer.DeepCopy() - applyUpdatesToCredentialIssuerFunc(credentialIssuer) - if equality.Semantic.DeepEqual(existingCredentialIssuer, credentialIssuer) { - // Nothing interesting would change as a result of this update, so skip it - return nil - } - - if _, err := credentialIssuersClient.Update(ctx, credentialIssuer, metav1.UpdateOptions{}); err != nil { - return err - } + existingCredentialIssuer = newCredentialIssuer } + + // check to see if we need to update the status + credentialIssuer := existingCredentialIssuer.DeepCopy() + applyUpdatesToCredentialIssuerFunc(&credentialIssuer.Status) + + if equality.Semantic.DeepEqual(existingCredentialIssuer, credentialIssuer) { + // Nothing interesting would change as a result of this update, so skip it + return nil + } + + if _, err := credentialIssuersClient.UpdateStatus(ctx, credentialIssuer, metav1.UpdateOptions{}); err != nil { + return err + } + return nil }) @@ -80,9 +81,5 @@ func minimalValidCredentialIssuer( Name: credentialIssuerName, Labels: credentialIssuerLabels, }, - Status: configv1alpha1.CredentialIssuerStatus{ - Strategies: []configv1alpha1.CredentialIssuerStrategy{}, - KubeConfigInfo: nil, - }, } } diff --git a/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go b/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go index 9745545e..1b1c865a 100644 --- a/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go +++ b/internal/controller/issuerconfig/create_or_update_credential_issuer_config_test.go @@ -23,7 +23,7 @@ import ( pinnipedfake "go.pinniped.dev/generated/1.20/client/concierge/clientset/versioned/fake" ) -func TestCreateOrUpdateCredentialIssuer(t *testing.T) { +func TestCreateOrUpdateCredentialIssuerStatus(t *testing.T) { spec.Run(t, "specs", func(t *testing.T, when spec.G, it spec.S) { var r *require.Assertions var ctx context.Context @@ -43,8 +43,8 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) when("the config does not exist", func() { - it("creates a new config which includes only the updates made by the func parameter", func() { - err := CreateOrUpdateCredentialIssuer( + it("creates a new config and then updates it with the func parameter", func() { + err := CreateOrUpdateCredentialIssuerStatus( ctx, credentialIssuerResourceName, map[string]string{ @@ -52,8 +52,8 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { "myLabelKey2": "myLabelValue2", }, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) { - configToUpdate.Status.KubeConfigInfo = &configv1alpha1.CredentialIssuerKubeConfigInfo{ + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) { + configToUpdate.KubeConfigInfo = &configv1alpha1.CredentialIssuerKubeConfigInfo{ CertificateAuthorityData: "some-ca-value", } }, @@ -64,6 +64,19 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, + &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + Labels: map[string]string{ + "myLabelKey1": "myLabelValue1", + "myLabelKey2": "myLabelValue2", + }, + }, + }, + ) + + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -74,7 +87,6 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }, }, Status: configv1alpha1.CredentialIssuerStatus{ - Strategies: []configv1alpha1.CredentialIssuerStrategy{}, KubeConfigInfo: &configv1alpha1.CredentialIssuerKubeConfigInfo{ Server: "", CertificateAuthorityData: "some-ca-value", @@ -83,7 +95,7 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }, ) - r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) + r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) when("there is an unexpected error while creating the existing object", func() { @@ -94,12 +106,12 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("returns an error", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) {}, + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) {}, ) r.EqualError(err, "could not create or update credentialissuer: create failed: error on create") }) @@ -138,7 +150,7 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("updates the existing config to only apply the updates made by the func parameter", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, credentialIssuerResourceName, map[string]string{ @@ -146,8 +158,8 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { "myLabelKey2": "myLabelValue2", }, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) { - configToUpdate.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) { + configToUpdate.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" }, ) r.NoError(err) @@ -157,24 +169,24 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { // Only the edited field should be changed. expectedUpdatedConfig := existingConfig.DeepCopy() expectedUpdatedConfig.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" - expectedUpdateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, expectedUpdatedConfig) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedUpdatedConfig) r.Equal([]coretesting.Action{expectedGetAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) it("avoids the cost of an update if the local updates made by the func parameter did not actually change anything", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) { - configToUpdate.Status.KubeConfigInfo.CertificateAuthorityData = "initial-ca-value" + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) { + configToUpdate.KubeConfigInfo.CertificateAuthorityData = "initial-ca-value" - t := configToUpdate.Status.Strategies[0].LastUpdateTime + t := configToUpdate.Strategies[0].LastUpdateTime loc, err := time.LoadLocation("Asia/Shanghai") r.NoError(err) - configToUpdate.Status.Strategies[0].LastUpdateTime = metav1.NewTime(t.In(loc)) + configToUpdate.Strategies[0].LastUpdateTime = metav1.NewTime(t.In(loc)) }, ) r.NoError(err) @@ -191,12 +203,12 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("returns an error", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) {}, + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) {}, ) r.EqualError(err, "could not create or update credentialissuer: get failed: error on get") }) @@ -210,13 +222,13 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("returns an error", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, credentialIssuerResourceName, map[string]string{}, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) { - configToUpdate.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) { + configToUpdate.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" }, ) r.EqualError(err, "could not create or update credentialissuer: error on update") @@ -248,7 +260,7 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("retries updates on conflict", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, credentialIssuerResourceName, map[string]string{ @@ -256,8 +268,8 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { "myLabelKey2": "myLabelValue2", }, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) { - configToUpdate.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) { + configToUpdate.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" }, ) r.NoError(err) @@ -267,13 +279,13 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { // The first attempted update only includes its own edits. firstExpectedUpdatedConfig := existingConfig.DeepCopy() firstExpectedUpdatedConfig.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" - firstExpectedUpdateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, firstExpectedUpdatedConfig) + firstExpectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", firstExpectedUpdatedConfig) // Both the edits made by this update and the edits made by the conflicting update should be included. secondExpectedUpdatedConfig := existingConfig.DeepCopy() secondExpectedUpdatedConfig.Status.KubeConfigInfo.Server = "some-other-server-value-from-conflicting-update" secondExpectedUpdatedConfig.Status.KubeConfigInfo.CertificateAuthorityData = "new-ca-value" - secondExpectedUpdateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, secondExpectedUpdatedConfig) + secondExpectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", secondExpectedUpdatedConfig) expectedActions := []coretesting.Action{ expectedGetAction, diff --git a/internal/controller/issuerconfig/kube_config_info_publisher.go b/internal/controller/issuerconfig/kube_config_info_publisher.go index 09f883b4..494a6376 100644 --- a/internal/controller/issuerconfig/kube_config_info_publisher.go +++ b/internal/controller/issuerconfig/kube_config_info_publisher.go @@ -104,14 +104,14 @@ func (c *kubeConigInfoPublisherController) Sync(ctx controllerlib.Context) error server = *c.serverOverride } - updateServerAndCAFunc := func(c *configv1alpha1.CredentialIssuer) { - c.Status.KubeConfigInfo = &configv1alpha1.CredentialIssuerKubeConfigInfo{ + updateServerAndCAFunc := func(c *configv1alpha1.CredentialIssuerStatus) { + c.KubeConfigInfo = &configv1alpha1.CredentialIssuerKubeConfigInfo{ Server: server, CertificateAuthorityData: certificateAuthorityData, } } - return CreateOrUpdateCredentialIssuer( + return CreateOrUpdateCredentialIssuerStatus( ctx.Context, c.credentialIssuerResourceName, c.credentialIssuerLabels, diff --git a/internal/controller/issuerconfig/kube_config_info_publisher_test.go b/internal/controller/issuerconfig/kube_config_info_publisher_test.go index fd6a6624..bea11703 100644 --- a/internal/controller/issuerconfig/kube_config_info_publisher_test.go +++ b/internal/controller/issuerconfig/kube_config_info_publisher_test.go @@ -115,12 +115,23 @@ func TestSync(t *testing.T) { var timeoutContextCancel context.CancelFunc var syncContext *controllerlib.Context - var expectedCredentialIssuer = func(expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *configv1alpha1.CredentialIssuer) { + var expectedCredentialIssuer = func(expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *configv1alpha1.CredentialIssuer, *configv1alpha1.CredentialIssuer) { expectedCredentialIssuerGVR := schema.GroupVersionResource{ Group: configv1alpha1.GroupName, Version: "v1alpha1", Resource: "credentialissuers", } + + expectedCreateCredentialIssuer := &configv1alpha1.CredentialIssuer{ + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + Labels: map[string]string{ + "myLabelKey1": "myLabelValue1", + "myLabelKey2": "myLabelValue2", + }, + }, + } + expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ ObjectMeta: metav1.ObjectMeta{ Name: credentialIssuerResourceName, @@ -130,14 +141,13 @@ func TestSync(t *testing.T) { }, }, Status: configv1alpha1.CredentialIssuerStatus{ - Strategies: []configv1alpha1.CredentialIssuerStrategy{}, KubeConfigInfo: &configv1alpha1.CredentialIssuerKubeConfigInfo{ Server: expectedServerURL, CertificateAuthorityData: expectedCAData, }, }, } - return expectedCredentialIssuerGVR, expectedCredentialIssuer + return expectedCredentialIssuerGVR, expectedCreateCredentialIssuer, expectedCredentialIssuer } // Defer starting the informers until the last possible moment so that the @@ -217,16 +227,21 @@ func TestSync(t *testing.T) { err := controllerlib.TestSync(t, subject, *syncContext) r.NoError(err) - expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( + expectedCredentialIssuerGVR, expectedCreateCredentialIssuer, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) r.Equal( []coretesting.Action{ - coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCredentialIssuer.Name), + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCreateCredentialIssuer.Name), coretesting.NewRootCreateAction( expectedCredentialIssuerGVR, + expectedCreateCredentialIssuer, + ), + coretesting.NewRootUpdateSubresourceAction( + expectedCredentialIssuerGVR, + "status", expectedCredentialIssuer, ), }, @@ -261,7 +276,7 @@ func TestSync(t *testing.T) { err := controllerlib.TestSync(t, subject, *syncContext) r.NoError(err) - expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( + expectedCredentialIssuerGVR, expectedCreateCredentialIssuer, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) @@ -269,9 +284,14 @@ func TestSync(t *testing.T) { r.Equal( []coretesting.Action{ - coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCredentialIssuer.Name), + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCreateCredentialIssuer.Name), coretesting.NewRootCreateAction( expectedCredentialIssuerGVR, + expectedCreateCredentialIssuer, + ), + coretesting.NewRootUpdateSubresourceAction( + expectedCredentialIssuerGVR, + "status", expectedCredentialIssuer, ), }, @@ -287,7 +307,7 @@ func TestSync(t *testing.T) { var credentialIssuer *configv1alpha1.CredentialIssuer it.Before(func() { - credentialIssuerGVR, credentialIssuer = expectedCredentialIssuer( + credentialIssuerGVR, _, credentialIssuer = expectedCredentialIssuer( kubeServerURL, caData, ) @@ -311,7 +331,7 @@ func TestSync(t *testing.T) { when("the CredentialIssuer is stale compared to the data in the ConfigMap", func() { it.Before(func() { - _, expectedCredentialIssuer := expectedCredentialIssuer( + _, _, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) @@ -324,14 +344,15 @@ func TestSync(t *testing.T) { err := controllerlib.TestSync(t, subject, *syncContext) r.NoError(err) - expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( + expectedCredentialIssuerGVR, _, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) expectedActions := []coretesting.Action{ coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCredentialIssuer.Name), - coretesting.NewRootUpdateAction( + coretesting.NewRootUpdateSubresourceAction( expectedCredentialIssuerGVR, + "status", expectedCredentialIssuer, ), } diff --git a/internal/controller/kubecertagent/annotater_test.go b/internal/controller/kubecertagent/annotater_test.go index ea3db3e3..f59fe1a3 100644 --- a/internal/controller/kubecertagent/annotater_test.go +++ b/internal/controller/kubecertagent/annotater_test.go @@ -265,8 +265,9 @@ func TestAnnotaterControllerSync(t *testing.T) { credentialIssuerGVR, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewRootUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -304,6 +305,13 @@ func TestAnnotaterControllerSync(t *testing.T) { startInformersAndController() err := controllerlib.TestSync(t, subject, *syncContext) + expectedCreateCredentialIssuer := &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + }, + } + expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -327,6 +335,11 @@ func TestAnnotaterControllerSync(t *testing.T) { ) expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, + expectedCreateCredentialIssuer, + ) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( + credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -335,6 +348,7 @@ func TestAnnotaterControllerSync(t *testing.T) { []coretesting.Action{ expectedGetAction, expectedCreateAction, + expectedUpdateAction, }, pinnipedAPIClient.Actions(), ) diff --git a/internal/controller/kubecertagent/creater_test.go b/internal/controller/kubecertagent/creater_test.go index d63363c1..e9592519 100644 --- a/internal/controller/kubecertagent/creater_test.go +++ b/internal/controller/kubecertagent/creater_test.go @@ -336,8 +336,9 @@ func TestCreaterControllerSync(t *testing.T) { credentialIssuerGVR, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewRootUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -375,6 +376,17 @@ func TestCreaterControllerSync(t *testing.T) { startInformersAndController() err := controllerlib.TestSync(t, subject, *syncContext) + expectedCreateCredentialIssuer := &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + Labels: map[string]string{ + "myLabelKey1": "myLabelValue1", + "myLabelKey2": "myLabelValue2", + }, + }, + } + expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -402,6 +414,11 @@ func TestCreaterControllerSync(t *testing.T) { ) expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, + expectedCreateCredentialIssuer, + ) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( + credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -410,6 +427,7 @@ func TestCreaterControllerSync(t *testing.T) { []coretesting.Action{ expectedGetAction, expectedCreateAction, + expectedUpdateAction, }, pinnipedAPIClient.Actions(), ) @@ -458,8 +476,9 @@ func TestCreaterControllerSync(t *testing.T) { credentialIssuerGVR, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewRootUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -514,6 +533,17 @@ func TestCreaterControllerSync(t *testing.T) { startInformersAndController() err := controllerlib.TestSync(t, subject, *syncContext) + expectedCreateCredentialIssuer := &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + Labels: map[string]string{ + "myLabelKey1": "myLabelValue1", + "myLabelKey2": "myLabelValue2", + }, + }, + } + expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -541,6 +571,11 @@ func TestCreaterControllerSync(t *testing.T) { ) expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, + expectedCreateCredentialIssuer, + ) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( + credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -549,6 +584,7 @@ func TestCreaterControllerSync(t *testing.T) { []coretesting.Action{ expectedGetAction, expectedCreateAction, + expectedUpdateAction, }, pinnipedAPIClient.Actions(), ) diff --git a/internal/controller/kubecertagent/execer_test.go b/internal/controller/kubecertagent/execer_test.go index e7ae425a..5b3d8d58 100644 --- a/internal/controller/kubecertagent/execer_test.go +++ b/internal/controller/kubecertagent/execer_test.go @@ -358,7 +358,7 @@ func TestManagerControllerSync(t *testing.T) { }, } expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewRootUpdateAction(credentialIssuerGVR, expectedCredentialIssuer) + expectedCreateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedCredentialIssuer) r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) }) @@ -389,6 +389,13 @@ func TestManagerControllerSync(t *testing.T) { it("also creates the the CredentialIssuer with the appropriate status field", func() { r.NoError(controllerlib.TestSync(t, subject, *syncContext)) + expectedCreateCredentialIssuer := &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + }, + } + expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -407,8 +414,9 @@ func TestManagerControllerSync(t *testing.T) { }, } expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCredentialIssuer) - r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCreateCredentialIssuer) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedCredentialIssuer) + r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) }) }) @@ -431,6 +439,13 @@ func TestManagerControllerSync(t *testing.T) { it("creates or updates the the CredentialIssuer status field with an error", func() { r.EqualError(controllerlib.TestSync(t, subject, *syncContext), podExecErrorMessage) + expectedCreateCredentialIssuer := &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + }, + } + expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -449,8 +464,9 @@ func TestManagerControllerSync(t *testing.T) { }, } expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCredentialIssuer) - r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCreateCredentialIssuer) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedCredentialIssuer) + r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) }) @@ -472,6 +488,13 @@ func TestManagerControllerSync(t *testing.T) { it("creates or updates the the CredentialIssuer status field with an error", func() { r.EqualError(controllerlib.TestSync(t, subject, *syncContext), podExecErrorMessage) + expectedCreateCredentialIssuer := &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, + }, + } + expectedCredentialIssuer := &configv1alpha1.CredentialIssuer{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -490,8 +513,9 @@ func TestManagerControllerSync(t *testing.T) { }, } expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCredentialIssuer) - r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCreateCredentialIssuer) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedCredentialIssuer) + r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) }) }) diff --git a/internal/controller/kubecertagent/kubecertagent.go b/internal/controller/kubecertagent/kubecertagent.go index 1dfe7a67..0122a5d4 100644 --- a/internal/controller/kubecertagent/kubecertagent.go +++ b/internal/controller/kubecertagent/kubecertagent.go @@ -287,19 +287,19 @@ func createOrUpdateCredentialIssuer(ctx context.Context, pinnipedAPIClient pinnipedclientset.Interface, err error, ) error { - return issuerconfig.CreateOrUpdateCredentialIssuer( + return issuerconfig.CreateOrUpdateCredentialIssuerStatus( ctx, ciConfig.Name, credentialIssuerLabels, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) { + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) { var strategyResult configv1alpha1.CredentialIssuerStrategy if err == nil { strategyResult = strategySuccess(clock) } else { strategyResult = strategyError(clock, err) } - configToUpdate.Status.Strategies = []configv1alpha1.CredentialIssuerStrategy{ + configToUpdate.Strategies = []configv1alpha1.CredentialIssuerStrategy{ strategyResult, } }, diff --git a/test/integration/kubeclient_test.go b/test/integration/kubeclient_test.go index 0448c4f6..dbe5c9c4 100644 --- a/test/integration/kubeclient_test.go +++ b/test/integration/kubeclient_test.go @@ -220,9 +220,6 @@ func TestKubeClientOwnerRef(t *testing.T) { GenerateName: "owner-ref-test-", OwnerReferences: nil, // no owner refs set }, - Status: conciergeconfigv1alpha1.CredentialIssuerStatus{ - Strategies: []conciergeconfigv1alpha1.CredentialIssuerStrategy{}, - }, }, metav1.CreateOptions{}, ) From 4c304e4224b8cbc52c8e3611a0eaf9e4b3f64f4b Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 21:20:19 -0500 Subject: [PATCH 14/15] Assert all APIs have a status subresource Signed-off-by: Monis Khan --- test/integration/kube_api_discovery_test.go | 50 +++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/integration/kube_api_discovery_test.go b/test/integration/kube_api_discovery_test.go index 9bab7796..c7783b81 100644 --- a/test/integration/kube_api_discovery_test.go +++ b/test/integration/kube_api_discovery_test.go @@ -103,6 +103,12 @@ func TestGetAPIResourceList(t *testing.T) { Verbs: []string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}, Categories: []string{"pinniped"}, }, + { + Name: "federationdomains/status", + Namespaced: true, + Kind: "FederationDomain", + Verbs: []string{"get", "patch", "update"}, + }, }, }, }, @@ -163,6 +169,12 @@ func TestGetAPIResourceList(t *testing.T) { Verbs: []string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}, Categories: []string{"pinniped"}, }, + { + Name: "credentialissuers/status", + Namespaced: false, + Kind: "CredentialIssuer", + Verbs: []string{"get", "patch", "update"}, + }, }, }, }, @@ -190,6 +202,12 @@ func TestGetAPIResourceList(t *testing.T) { Verbs: []string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}, Categories: []string{"pinniped", "pinniped-authenticator", "pinniped-authenticators"}, }, + { + Name: "webhookauthenticators/status", + Namespaced: false, + Kind: "WebhookAuthenticator", + Verbs: []string{"get", "patch", "update"}, + }, { Name: "jwtauthenticators", SingularName: "jwtauthenticator", @@ -198,6 +216,12 @@ func TestGetAPIResourceList(t *testing.T) { Verbs: []string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}, Categories: []string{"pinniped", "pinniped-authenticator", "pinniped-authenticators"}, }, + { + Name: "jwtauthenticators/status", + Namespaced: false, + Kind: "JWTAuthenticator", + Verbs: []string{"get", "patch", "update"}, + }, }, }, }, @@ -253,6 +277,32 @@ func TestGetAPIResourceList(t *testing.T) { } }) + t.Run("every API has a status subresource", func(t *testing.T) { + t.Parallel() + + var regular, status []string + + for _, r := range resources { + if !strings.Contains(r.GroupVersion, env.APIGroupSuffix) { + continue + } + + for _, a := range r.APIResources { + if a.Name == "tokencredentialrequests" { + continue // our special aggregated API with its own magical properties + } + + if strings.HasSuffix(a.Name, "/status") { + status = append(status, strings.TrimSuffix(a.Name, "/status")) + } else { + regular = append(regular, a.Name) + } + } + } + + assert.Equal(t, regular, status) + }) + t.Run("Pinniped resources do not have short names", func(t *testing.T) { t.Parallel() for _, r := range resources { From b04fd46319642e1630312cd550577b383bab6293 Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Wed, 10 Feb 2021 21:46:03 -0500 Subject: [PATCH 15/15] Update federation domain logic to use status subresource Signed-off-by: Monis Khan --- cmd/pinniped-supervisor/main.go | 12 ++-- .../federation_domain_watcher.go | 2 +- .../federation_domain_watcher_test.go | 57 ++++++++++++------- .../generator/federation_domain_secrets.go | 16 +++--- .../federation_domain_secrets_test.go | 18 +++--- .../supervisorconfig/jwks_writer.go | 6 +- .../supervisorconfig/jwks_writer_test.go | 4 +- 7 files changed, 67 insertions(+), 48 deletions(-) diff --git a/cmd/pinniped-supervisor/main.go b/cmd/pinniped-supervisor/main.go index 94d12817..199a8e7b 100644 --- a/cmd/pinniped-supervisor/main.go +++ b/cmd/pinniped-supervisor/main.go @@ -175,8 +175,8 @@ func startControllers( secretCache.SetTokenHMACKey(federationDomainIssuer, symmetricKey) }, ), - func(fd *configv1alpha1.FederationDomain) *corev1.LocalObjectReference { - return &fd.Status.Secrets.TokenSigningKey + func(fd *configv1alpha1.FederationDomainStatus) *corev1.LocalObjectReference { + return &fd.Secrets.TokenSigningKey }, kubeClient, pinnipedClient, @@ -198,8 +198,8 @@ func startControllers( secretCache.SetStateEncoderHashKey(federationDomainIssuer, symmetricKey) }, ), - func(fd *configv1alpha1.FederationDomain) *corev1.LocalObjectReference { - return &fd.Status.Secrets.StateSigningKey + func(fd *configv1alpha1.FederationDomainStatus) *corev1.LocalObjectReference { + return &fd.Secrets.StateSigningKey }, kubeClient, pinnipedClient, @@ -221,8 +221,8 @@ func startControllers( secretCache.SetStateEncoderBlockKey(federationDomainIssuer, symmetricKey) }, ), - func(fd *configv1alpha1.FederationDomain) *corev1.LocalObjectReference { - return &fd.Status.Secrets.StateEncryptionKey + func(fd *configv1alpha1.FederationDomainStatus) *corev1.LocalObjectReference { + return &fd.Secrets.StateEncryptionKey }, kubeClient, pinnipedClient, diff --git a/internal/controller/supervisorconfig/federation_domain_watcher.go b/internal/controller/supervisorconfig/federation_domain_watcher.go index 4ba54cc7..670d5ced 100644 --- a/internal/controller/supervisorconfig/federation_domain_watcher.go +++ b/internal/controller/supervisorconfig/federation_domain_watcher.go @@ -204,7 +204,7 @@ func (c *federationDomainWatcherController) updateStatus( federationDomain.Status.Status = status federationDomain.Status.Message = message federationDomain.Status.LastUpdateTime = timePtr(metav1.NewTime(c.clock.Now())) - _, err = c.client.ConfigV1alpha1().FederationDomains(namespace).Update(ctx, federationDomain, metav1.UpdateOptions{}) + _, err = c.client.ConfigV1alpha1().FederationDomains(namespace).UpdateStatus(ctx, federationDomain, metav1.UpdateOptions{}) return err }) } diff --git a/internal/controller/supervisorconfig/federation_domain_watcher_test.go b/internal/controller/supervisorconfig/federation_domain_watcher_test.go index e7324c42..34930e81 100644 --- a/internal/controller/supervisorconfig/federation_domain_watcher_test.go +++ b/internal/controller/supervisorconfig/federation_domain_watcher_test.go @@ -222,8 +222,9 @@ func TestSync(t *testing.T) { federationDomain1.Namespace, federationDomain1.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain1.Namespace, federationDomain1, ), @@ -232,8 +233,9 @@ func TestSync(t *testing.T) { federationDomain2.Namespace, federationDomain2.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain2.Namespace, federationDomain2, ), @@ -271,8 +273,9 @@ func TestSync(t *testing.T) { federationDomain2.Namespace, federationDomain2.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain2.Namespace, federationDomain2, ), @@ -356,8 +359,9 @@ func TestSync(t *testing.T) { federationDomain1.Namespace, federationDomain1.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain1.Namespace, federationDomain1, ), @@ -366,8 +370,9 @@ func TestSync(t *testing.T) { federationDomain2.Namespace, federationDomain2.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain2.Namespace, federationDomain2, ), @@ -422,8 +427,9 @@ func TestSync(t *testing.T) { federationDomain.Namespace, federationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain.Namespace, federationDomain, ), @@ -432,8 +438,9 @@ func TestSync(t *testing.T) { federationDomain.Namespace, federationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain.Namespace, federationDomain, ), @@ -468,8 +475,9 @@ func TestSync(t *testing.T) { federationDomain.Namespace, federationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain.Namespace, federationDomain, ), @@ -568,8 +576,9 @@ func TestSync(t *testing.T) { invalidFederationDomain.Namespace, invalidFederationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", invalidFederationDomain.Namespace, invalidFederationDomain, ), @@ -578,8 +587,9 @@ func TestSync(t *testing.T) { validFederationDomain.Namespace, validFederationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", validFederationDomain.Namespace, validFederationDomain, ), @@ -640,8 +650,9 @@ func TestSync(t *testing.T) { invalidFederationDomain.Namespace, invalidFederationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", invalidFederationDomain.Namespace, invalidFederationDomain, ), @@ -650,8 +661,9 @@ func TestSync(t *testing.T) { validFederationDomain.Namespace, validFederationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", validFederationDomain.Namespace, validFederationDomain, ), @@ -732,8 +744,9 @@ func TestSync(t *testing.T) { federationDomainDuplicate1.Namespace, federationDomainDuplicate1.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomainDuplicate1.Namespace, federationDomainDuplicate1, ), @@ -742,8 +755,9 @@ func TestSync(t *testing.T) { federationDomainDuplicate2.Namespace, federationDomainDuplicate2.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomainDuplicate2.Namespace, federationDomainDuplicate2, ), @@ -752,8 +766,9 @@ func TestSync(t *testing.T) { federationDomain.Namespace, federationDomain.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomain.Namespace, federationDomain, ), @@ -906,8 +921,9 @@ func TestSync(t *testing.T) { federationDomainSameIssuerAddress1.Namespace, federationDomainSameIssuerAddress1.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomainSameIssuerAddress1.Namespace, federationDomainSameIssuerAddress1, ), @@ -916,8 +932,9 @@ func TestSync(t *testing.T) { federationDomainSameIssuerAddress2.Namespace, federationDomainSameIssuerAddress2.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomainSameIssuerAddress2.Namespace, federationDomainSameIssuerAddress2, ), @@ -926,8 +943,9 @@ func TestSync(t *testing.T) { federationDomainDifferentIssuerAddress.Namespace, federationDomainDifferentIssuerAddress.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomainDifferentIssuerAddress.Namespace, federationDomainDifferentIssuerAddress, ), @@ -936,8 +954,9 @@ func TestSync(t *testing.T) { federationDomainWithInvalidIssuerURL.Namespace, federationDomainWithInvalidIssuerURL.Name, ), - coretesting.NewUpdateAction( + coretesting.NewUpdateSubresourceAction( federationDomainGVR, + "status", federationDomainWithInvalidIssuerURL.Namespace, federationDomainWithInvalidIssuerURL, ), diff --git a/internal/controller/supervisorconfig/generator/federation_domain_secrets.go b/internal/controller/supervisorconfig/generator/federation_domain_secrets.go index 5afead36..aa5b5121 100644 --- a/internal/controller/supervisorconfig/generator/federation_domain_secrets.go +++ b/internal/controller/supervisorconfig/generator/federation_domain_secrets.go @@ -26,7 +26,7 @@ import ( type federationDomainSecretsController struct { secretHelper SecretHelper - secretRefFunc func(domain *configv1alpha1.FederationDomain) *corev1.LocalObjectReference + secretRefFunc func(domain *configv1alpha1.FederationDomainStatus) *corev1.LocalObjectReference kubeClient kubernetes.Interface pinnipedClient pinnipedclientset.Interface federationDomainInformer configinformers.FederationDomainInformer @@ -38,7 +38,7 @@ type federationDomainSecretsController struct { // provides the parent/child mapping logic. func NewFederationDomainSecretsController( secretHelper SecretHelper, - secretRefFunc func(domain *configv1alpha1.FederationDomain) *corev1.LocalObjectReference, + secretRefFunc func(domain *configv1alpha1.FederationDomainStatus) *corev1.LocalObjectReference, kubeClient kubernetes.Interface, pinnipedClient pinnipedclientset.Interface, secretInformer corev1informers.SecretInformer, @@ -117,7 +117,7 @@ func (c *federationDomainSecretsController) Sync(ctx controllerlib.Context) erro ) federationDomain = c.secretHelper.ObserveActiveSecretAndUpdateParentFederationDomain(federationDomain, existingSecret) - if err := c.updateFederationDomain(ctx.Context, federationDomain); err != nil { + if err := c.updateFederationDomainStatus(ctx.Context, federationDomain); err != nil { return fmt.Errorf("failed to update federationdomain: %w", err) } plog.Debug("updated federationdomain", "federationdomain", klog.KObj(federationDomain), "secret", klog.KObj(newSecret)) @@ -133,7 +133,7 @@ func (c *federationDomainSecretsController) Sync(ctx controllerlib.Context) erro plog.Debug("created/updated secret", "federationdomain", klog.KObj(federationDomain), "secret", klog.KObj(newSecret)) federationDomain = c.secretHelper.ObserveActiveSecretAndUpdateParentFederationDomain(federationDomain, newSecret) - if err := c.updateFederationDomain(ctx.Context, federationDomain); err != nil { + if err := c.updateFederationDomainStatus(ctx.Context, federationDomain); err != nil { return fmt.Errorf("failed to update federationdomain: %w", err) } plog.Debug("updated federationdomain", "federationdomain", klog.KObj(federationDomain), "secret", klog.KObj(newSecret)) @@ -205,7 +205,7 @@ func (c *federationDomainSecretsController) createOrUpdateSecret( }) } -func (c *federationDomainSecretsController) updateFederationDomain( +func (c *federationDomainSecretsController) updateFederationDomainStatus( ctx context.Context, newFederationDomain *configv1alpha1.FederationDomain, ) error { @@ -216,14 +216,14 @@ func (c *federationDomainSecretsController) updateFederationDomain( return fmt.Errorf("failed to get federationdomain %s/%s: %w", newFederationDomain.Namespace, newFederationDomain.Name, err) } - oldFederationDomainSecretRef := c.secretRefFunc(oldFederationDomain) - newFederationDomainSecretRef := c.secretRefFunc(newFederationDomain) + oldFederationDomainSecretRef := c.secretRefFunc(&oldFederationDomain.Status) + newFederationDomainSecretRef := c.secretRefFunc(&newFederationDomain.Status) if reflect.DeepEqual(oldFederationDomainSecretRef, newFederationDomainSecretRef) { return nil } *oldFederationDomainSecretRef = *newFederationDomainSecretRef - _, err = federationDomainClient.Update(ctx, oldFederationDomain, metav1.UpdateOptions{}) + _, err = federationDomainClient.UpdateStatus(ctx, oldFederationDomain, metav1.UpdateOptions{}) return err }) } diff --git a/internal/controller/supervisorconfig/generator/federation_domain_secrets_test.go b/internal/controller/supervisorconfig/generator/federation_domain_secrets_test.go index 44fc46e6..ea8dc374 100644 --- a/internal/controller/supervisorconfig/generator/federation_domain_secrets_test.go +++ b/internal/controller/supervisorconfig/generator/federation_domain_secrets_test.go @@ -393,7 +393,7 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithTokenSigningKey), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithTokenSigningKey), }, wantSecretActions: []kubetesting.Action{ kubetesting.NewGetAction(secretGVR, namespace, goodSecret.Name), @@ -416,7 +416,7 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithJWKSAndTokenSigningKey), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithJWKSAndTokenSigningKey), }, wantSecretActions: []kubetesting.Action{ kubetesting.NewGetAction(secretGVR, namespace, goodSecret.Name), @@ -457,7 +457,7 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithTokenSigningKey), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithTokenSigningKey), }, wantSecretActions: []kubetesting.Action{ kubetesting.NewGetAction(secretGVR, namespace, goodSecret.Name), @@ -484,7 +484,7 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithTokenSigningKey), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithTokenSigningKey), }, wantSecretActions: []kubetesting.Action{ kubetesting.NewGetAction(secretGVR, namespace, goodSecret.Name), @@ -562,7 +562,7 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithTokenSigningKey), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithTokenSigningKey), }, wantSecretActions: []kubetesting.Action{ kubetesting.NewGetAction(secretGVR, namespace, goodSecret.Name), @@ -615,9 +615,9 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithTokenSigningKey), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithTokenSigningKey), kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithTokenSigningKey), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithTokenSigningKey), }, wantSecretActions: []kubetesting.Action{ kubetesting.NewGetAction(secretGVR, namespace, goodSecret.Name), @@ -677,8 +677,8 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) { c := NewFederationDomainSecretsController( secretHelper, - func(fd *configv1alpha1.FederationDomain) *corev1.LocalObjectReference { - return &fd.Status.Secrets.TokenSigningKey + func(fd *configv1alpha1.FederationDomainStatus) *corev1.LocalObjectReference { + return &fd.Secrets.TokenSigningKey }, kubeAPIClient, pinnipedAPIClient, diff --git a/internal/controller/supervisorconfig/jwks_writer.go b/internal/controller/supervisorconfig/jwks_writer.go index be74961a..26669802 100644 --- a/internal/controller/supervisorconfig/jwks_writer.go +++ b/internal/controller/supervisorconfig/jwks_writer.go @@ -161,7 +161,7 @@ func (c *jwksWriterController) Sync(ctx controllerlib.Context) error { // Ensure that the FederationDomain points to the secret. newFederationDomain := federationDomain.DeepCopy() newFederationDomain.Status.Secrets.JWKS.Name = secret.Name - if err := c.updateFederationDomain(ctx.Context, newFederationDomain); err != nil { + if err := c.updateFederationDomainStatus(ctx.Context, newFederationDomain); err != nil { return fmt.Errorf("cannot update FederationDomain: %w", err) } plog.Debug("updated FederationDomain", "federationdomain", klog.KObj(newFederationDomain)) @@ -283,7 +283,7 @@ func (c *jwksWriterController) createOrUpdateSecret( }) } -func (c *jwksWriterController) updateFederationDomain( +func (c *jwksWriterController) updateFederationDomainStatus( ctx context.Context, newFederationDomain *configv1alpha1.FederationDomain, ) error { @@ -300,7 +300,7 @@ func (c *jwksWriterController) updateFederationDomain( } oldFederationDomain.Status.Secrets.JWKS.Name = newFederationDomain.Status.Secrets.JWKS.Name - _, err = federationDomainClient.Update(ctx, oldFederationDomain, metav1.UpdateOptions{}) + _, err = federationDomainClient.UpdateStatus(ctx, oldFederationDomain, metav1.UpdateOptions{}) return err }) } diff --git a/internal/controller/supervisorconfig/jwks_writer_test.go b/internal/controller/supervisorconfig/jwks_writer_test.go index 472035e4..811a754c 100644 --- a/internal/controller/supervisorconfig/jwks_writer_test.go +++ b/internal/controller/supervisorconfig/jwks_writer_test.go @@ -355,7 +355,7 @@ func TestJWKSWriterControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithStatus), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithStatus), }, }, { @@ -373,7 +373,7 @@ func TestJWKSWriterControllerSync(t *testing.T) { }, wantFederationDomainActions: []kubetesting.Action{ kubetesting.NewGetAction(federationDomainGVR, namespace, goodFederationDomain.Name), - kubetesting.NewUpdateAction(federationDomainGVR, namespace, goodFederationDomainWithStatus), + kubetesting.NewUpdateSubresourceAction(federationDomainGVR, "status", namespace, goodFederationDomainWithStatus), }, }, {