diff --git a/Dockerfile b/Dockerfile index fd05e51e..75f33572 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,11 +27,11 @@ RUN \ ./cmd/local-user-authenticator/... # Use a Debian slim image to grab a reasonable default CA bundle. -FROM debian:10.7-slim AS get-ca-bundle-env +FROM debian:10.8-slim AS get-ca-bundle-env RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* /var/cache/debconf/* # Use a runtime image based on Debian slim. -FROM debian:10.7-slim +FROM debian:10.8-slim COPY --from=get-ca-bundle-env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # Copy the binaries from the build-env stage. diff --git a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl index 3e159148..813460fa 100644 --- a/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_jwt.go.tmpl @@ -57,9 +57,11 @@ 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: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 d12a1f3c..2bf626d2 100644 --- a/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl @@ -29,9 +29,11 @@ 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: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 f462056d..63d59446 100644 --- a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl +++ b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl @@ -67,13 +67,16 @@ 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 +// +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } 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/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"` 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/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/deprecated.go b/cmd/pinniped/cmd/deprecated.go deleted file mode 100644 index eeca0d1a..00000000 --- a/cmd/pinniped/cmd/deprecated.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package cmd - -import ( - "encoding/base64" - "fmt" - "os" - - "github.com/spf13/cobra" - - "go.pinniped.dev/internal/here" - "go.pinniped.dev/internal/plog" -) - -//nolint: gochecknoinits -func init() { - rootCmd.AddCommand(legacyGetKubeconfigCommand(kubeconfigRealDeps())) - rootCmd.AddCommand(legacyExchangeTokenCommand(staticLoginRealDeps())) -} - -func legacyGetKubeconfigCommand(deps kubeconfigDeps) *cobra.Command { - var ( - cmd = &cobra.Command{ - Hidden: true, - Deprecated: "Please use `pinniped get kubeconfig` instead.", - - Args: cobra.NoArgs, // do not accept positional arguments for this command - Use: "get-kubeconfig", - Short: "Print a kubeconfig for authenticating into a cluster via Pinniped", - Long: here.Doc(` - Print a kubeconfig for authenticating into a cluster via Pinniped. - Requires admin-like access to the cluster using the current - kubeconfig context in order to access Pinniped's metadata. - The current kubeconfig is found similar to how kubectl finds it: - using the value of the --kubeconfig option, or if that is not - specified then from the value of the KUBECONFIG environment - variable, or if that is not specified then it defaults to - .kube/config in your home directory. - Prints a kubeconfig which is suitable to access the cluster using - Pinniped as the authentication mechanism. This kubeconfig output - can be saved to a file and used with future kubectl commands, e.g.: - pinniped get-kubeconfig --token $MY_TOKEN > $HOME/mycluster-kubeconfig - kubectl --kubeconfig $HOME/mycluster-kubeconfig get pods - `), - } - token string - kubeconfig string - contextOverride string - namespace string - authenticatorType string - authenticatorName string - apiGroupSuffix string - ) - - cmd.Flags().StringVar(&token, "token", "", "Credential to include in the resulting kubeconfig output (Required)") - cmd.Flags().StringVar(&kubeconfig, "kubeconfig", "", "Path to the kubeconfig file") - cmd.Flags().StringVar(&contextOverride, "kubeconfig-context", "", "Kubeconfig context override") - cmd.Flags().StringVar(&namespace, "pinniped-namespace", "pinniped-concierge", "Namespace in which Pinniped was installed") - cmd.Flags().StringVar(&authenticatorType, "authenticator-type", "", "Authenticator type (e.g., 'webhook', 'jwt')") - cmd.Flags().StringVar(&authenticatorName, "authenticator-name", "", "Authenticator name") - cmd.Flags().StringVar(&apiGroupSuffix, "api-group-suffix", "pinniped.dev", "Concierge API group suffix") - - mustMarkRequired(cmd, "token") - plog.RemoveKlogGlobalFlags() - cmd.RunE = func(cmd *cobra.Command, args []string) error { - return runGetKubeconfig(cmd.OutOrStdout(), deps, getKubeconfigParams{ - kubeconfigPath: kubeconfig, - kubeconfigContextOverride: contextOverride, - staticToken: token, - concierge: getKubeconfigConciergeParams{ - namespace: namespace, - authenticatorName: authenticatorName, - authenticatorType: authenticatorType, - apiGroupSuffix: apiGroupSuffix, - }, - }) - } - return cmd -} - -func legacyExchangeTokenCommand(deps staticLoginDeps) *cobra.Command { - cmd := &cobra.Command{ - Hidden: true, - Deprecated: "Please use `pinniped login static` instead.", - - Args: cobra.NoArgs, // do not accept positional arguments for this command - Use: "exchange-credential", - Short: "Exchange a credential for a cluster-specific access credential", - Long: here.Doc(` - Exchange a credential which proves your identity for a time-limited, - cluster-specific access credential. - Designed to be conveniently used as an credential plugin for kubectl. - See the help message for 'pinniped get-kubeconfig' for more - information about setting up a kubeconfig file using Pinniped. - Requires all of the following environment variables, which are - typically set in the kubeconfig: - - PINNIPED_TOKEN: the token to send to Pinniped for exchange - - PINNIPED_NAMESPACE: the namespace of the authenticator to authenticate - against - - PINNIPED_AUTHENTICATOR_TYPE: the type of authenticator to authenticate - against (e.g., "webhook", "jwt") - - PINNIPED_AUTHENTICATOR_NAME: the name of the authenticator to authenticate - against - - PINNIPED_CA_BUNDLE: the CA bundle to trust when calling - Pinniped's HTTPS endpoint - - PINNIPED_K8S_API_ENDPOINT: the URL for the Pinniped credential - exchange API - For more information about credential plugins in general, see - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins - `), - } - plog.RemoveKlogGlobalFlags() - cmd.RunE = func(cmd *cobra.Command, args []string) error { - // Make a little helper to grab OS environment variables and keep a list that were missing. - var missing []string - getEnv := func(name string) string { - value, ok := os.LookupEnv(name) - if !ok { - missing = append(missing, name) - } - return value - } - flags := staticLoginParams{ - staticToken: getEnv("PINNIPED_TOKEN"), - conciergeEnabled: true, - conciergeNamespace: getEnv("PINNIPED_NAMESPACE"), - conciergeAuthenticatorType: getEnv("PINNIPED_AUTHENTICATOR_TYPE"), - conciergeAuthenticatorName: getEnv("PINNIPED_AUTHENTICATOR_NAME"), - conciergeEndpoint: getEnv("PINNIPED_K8S_API_ENDPOINT"), - conciergeCABundle: base64.StdEncoding.EncodeToString([]byte(getEnv("PINNIPED_CA_BUNDLE"))), - } - if len(missing) > 0 { - return fmt.Errorf("failed to get credential: required environment variable(s) not set: %v", missing) - } - return runStaticLogin(cmd.OutOrStdout(), deps, flags) - } - return cmd -} diff --git a/cmd/pinniped/cmd/kubeconfig.go b/cmd/pinniped/cmd/kubeconfig.go index 4937b03d..a46ce3d5 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 @@ -94,13 +93,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() @@ -108,7 +108,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") @@ -129,10 +129,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 @@ -188,7 +191,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, ) @@ -278,7 +280,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) } @@ -303,7 +305,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="+flags.concierge.endpoint, @@ -344,7 +345,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() @@ -352,9 +353,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) } @@ -362,11 +363,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) } @@ -379,10 +380,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 09918829..6d77c435 100644 --- a/cmd/pinniped/cmd/kubeconfig_test.go +++ b/cmd/pinniped/cmd/kubeconfig_test.go @@ -66,8 +66,7 @@ func TestGetKubeconfig(t *testing.T) { --concierge-authenticator-type string Concierge authenticator type (e.g., 'webhook', 'jwt') (default: autodiscover) --concierge-ca-bundle string Path to TLS certificate authority bundle (PEM format, optional, can be repeated) 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") - --concierge-use-impersonation-proxy Whether the concierge cluster uses an impersonation proxy + --concierge-use-impersonation-proxy Whether the concierge cluster uses an impersonation proxy -h, --help help for kubeconfig --kubeconfig string Path to kubeconfig file --kubeconfig-context string Kubeconfig context name (default: current active context) @@ -216,34 +215,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(` @@ -254,11 +251,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", @@ -268,7 +264,7 @@ 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 `), }, { @@ -288,12 +284,11 @@ func TestGetKubeconfig(t *testing.T) { 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(` @@ -314,11 +309,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 @@ -345,7 +339,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 @@ -360,11 +353,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 @@ -391,7 +383,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 @@ -409,7 +400,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", @@ -444,7 +435,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 @@ -476,7 +466,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(` @@ -504,7 +494,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 @@ -534,7 +523,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", @@ -569,7 +558,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://impersonation-proxy-endpoint.test diff --git a/cmd/pinniped/cmd/login_oidc.go b/cmd/pinniped/cmd/login_oidc.go index 3d38fb2d..4d04d5f5 100644 --- a/cmd/pinniped/cmd/login_oidc.go +++ b/cmd/pinniped/cmd/login_oidc.go @@ -65,7 +65,6 @@ type oidcLoginFlags struct { debugSessionCache bool requestAudience string conciergeEnabled bool - conciergeNamespace string conciergeAuthenticatorType string conciergeAuthenticatorName string conciergeEndpoint string @@ -76,13 +75,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") @@ -95,7 +95,7 @@ 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") @@ -103,10 +103,14 @@ func oidcLoginCommand(deps oidcLoginCommandDeps) *cobra.Command { cmd.Flags().StringVar(&flags.conciergeAPIGroupSuffix, "concierge-api-group-suffix", "pinniped.dev", "Concierge API group suffix") cmd.Flags().BoolVar(&flags.useImpersonationProxy, "concierge-use-impersonation-proxy", false, "Whether the concierge cluster uses an impersonation proxy") - 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 { @@ -141,7 +145,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), @@ -189,7 +192,7 @@ func runOIDCLogin(cmd *cobra.Command, deps oidcLoginCommandDeps, flags oidcLogin if concierge != nil && flags.useImpersonationProxy { // Put the token into a TokenCredentialRequest // put the TokenCredentialRequest in an ExecCredential - req, err := execCredentialForImpersonationProxy(token.IDToken.Token, flags.conciergeAuthenticatorType, flags.conciergeNamespace, flags.conciergeAuthenticatorName, &token.IDToken.Expiry) + req, err := execCredentialForImpersonationProxy(token.IDToken.Token, flags.conciergeAuthenticatorType, flags.conciergeAuthenticatorName, &token.IDToken.Expiry) if err != nil { return err } @@ -260,7 +263,6 @@ func mustGetConfigDir() string { func execCredentialForImpersonationProxy( idToken string, conciergeAuthenticatorType string, - conciergeNamespace string, conciergeAuthenticatorName string, tokenExpiry *metav1.Time, ) (*clientauthv1beta1.ExecCredential, error) { @@ -275,9 +277,6 @@ func execCredentialForImpersonationProxy( return nil, fmt.Errorf(`invalid authenticator type: %q, supported values are "webhook" and "jwt"`, kind) } reqJSON, err := json.Marshal(&loginv1alpha1.TokenCredentialRequest{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: conciergeNamespace, - }, TypeMeta: metav1.TypeMeta{ Kind: "TokenCredentialRequest", APIVersion: loginv1alpha1.GroupName + "/v1alpha1", diff --git a/cmd/pinniped/cmd/login_oidc_test.go b/cmd/pinniped/cmd/login_oidc_test.go index 6d51a588..bdc57a7e 100644 --- a/cmd/pinniped/cmd/login_oidc_test.go +++ b/cmd/pinniped/cmd/login_oidc_test.go @@ -71,7 +71,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") --concierge-use-impersonation-proxy Whether the concierge cluster uses an impersonation proxy --enable-concierge Exchange the OIDC ID token with the Pinniped concierge during login -h, --help help for oidc @@ -193,7 +192,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/", @@ -277,9 +275,6 @@ func TestLoginOIDCCommand(t *testing.T) { func impersonationProxyTestToken(token string) string { reqJSON, _ := json.Marshal(&loginv1alpha1.TokenCredentialRequest{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "pinniped-concierge", - }, TypeMeta: metav1.TypeMeta{ Kind: "TokenCredentialRequest", APIVersion: loginv1alpha1.GroupName + "/v1alpha1", diff --git a/cmd/pinniped/cmd/login_static.go b/cmd/pinniped/cmd/login_static.go index a8090935..409952c8 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 @@ -52,18 +51,19 @@ 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") @@ -71,7 +71,11 @@ func staticLoginCommand(deps staticLoginDeps) *cobra.Command { cmd.Flags().StringVar(&flags.conciergeAPIGroupSuffix, "concierge-api-group-suffix", "pinniped.dev", "Concierge API group suffix") cmd.Flags().BoolVar(&flags.useImpersonationProxy, "concierge-use-impersonation-proxy", false, "Whether the concierge cluster uses an impersonation proxy") 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 { @@ -83,7 +87,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), @@ -124,7 +127,7 @@ func runStaticLogin(out io.Writer, deps staticLoginDeps, flags staticLoginParams if concierge != nil && flags.useImpersonationProxy { // Put the token into a TokenCredentialRequest // put the TokenCredentialRequest in an ExecCredential - req, err := execCredentialForImpersonationProxy(token, flags.conciergeAuthenticatorType, flags.conciergeNamespace, flags.conciergeAuthenticatorName, nil) + req, err := execCredentialForImpersonationProxy(token, flags.conciergeAuthenticatorType, flags.conciergeAuthenticatorName, nil) if err != nil { return err } diff --git a/cmd/pinniped/cmd/login_static_test.go b/cmd/pinniped/cmd/login_static_test.go index 64fbfe5d..de71cae2 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") --concierge-use-impersonation-proxy Whether the concierge cluster uses an impersonation proxy --enable-concierge Exchange the token with the Pinniped concierge during login -h, --help help for static diff --git a/cmd/pinniped/cmd/root.go b/cmd/pinniped/cmd/root.go index 8b5d01ae..2b6eb0dc 100644 --- a/cmd/pinniped/cmd/root.go +++ b/cmd/pinniped/cmd/root.go @@ -1,4 +1,4 @@ -// Copyright 2020 the Pinniped contributors. All Rights Reserved. +// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package cmd @@ -7,6 +7,8 @@ import ( "os" "github.com/spf13/cobra" + + "go.pinniped.dev/internal/plog" ) //nolint: gochecknoglobals @@ -17,6 +19,12 @@ var rootCmd = &cobra.Command{ SilenceUsage: true, // do not print usage message when commands fail } +//nolint: gochecknoinits +func init() { + // We don't want klog flags showing up in our CLI. + plog.RemoveKlogGlobalFlags() +} + // Execute adds all child commands to the root command and sets flags appropriately. // This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { diff --git a/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..9f5ec0fc 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 @@ -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 d31bae12..3ccd3216 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 @@ -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 9b4c0056..900db6cb 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: @@ -98,11 +98,11 @@ spec: required: - strategies type: object - required: - - status type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/deploy/concierge/rbac.yaml b/deploy/concierge/rbac.yaml index fe2414cb..503ad07a 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,6 +34,18 @@ rules: - apiGroups: [""] resources: ["users", "groups"] verbs: ["impersonate"] + - apiGroups: + - #@ pinnipedDevAPIGroupWithPrefix("config.concierge") + resources: [ credentialissuers ] + verbs: [ get, list, watch, create ] + - apiGroups: + - #@ pinnipedDevAPIGroupWithPrefix("config.concierge") + resources: [ credentialissuers/status ] + verbs: [get, patch, update] + - apiGroups: + - #@ pinnipedDevAPIGroupWithPrefix("authentication.concierge") + resources: [ jwtauthenticators, webhookauthenticators ] + verbs: [ get, list, watch ] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -72,11 +84,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/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/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] 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..813460fa 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,9 +57,11 @@ 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: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 d12a1f3c..2bf626d2 100644 --- a/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.17/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,9 +29,11 @@ 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: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 f462056d..63d59446 100644 --- a/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.17/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,13 +67,16 @@ 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 +// +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } 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/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/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.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.17/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..9f5ec0fc 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 @@ -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 d31bae12..3ccd3216 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 @@ -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 9b4c0056..900db6cb 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: @@ -98,11 +98,11 @@ spec: required: - strategies type: object - required: - - status 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 3e159148..813460fa 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,9 +57,11 @@ 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: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 d12a1f3c..2bf626d2 100644 --- a/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.18/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,9 +29,11 @@ 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: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 f462056d..63d59446 100644 --- a/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.18/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,13 +67,16 @@ 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 +// +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } 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/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/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.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.18/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..9f5ec0fc 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 @@ -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 d31bae12..3ccd3216 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 @@ -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 9b4c0056..900db6cb 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: @@ -98,11 +98,11 @@ spec: required: - strategies type: object - required: - - status 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 3e159148..813460fa 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,9 +57,11 @@ 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: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 d12a1f3c..2bf626d2 100644 --- a/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.19/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,9 +29,11 @@ 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: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 f462056d..63d59446 100644 --- a/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.19/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,13 +67,16 @@ 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 +// +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } 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/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/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.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml b/generated/1.19/crds/authentication.concierge.pinniped.dev_jwtauthenticators.yaml index e800411e..9f5ec0fc 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 @@ -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 d31bae12..3ccd3216 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 @@ -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 9b4c0056..900db6cb 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: @@ -98,11 +98,11 @@ spec: required: - strategies type: object - required: - - status 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 3e159148..813460fa 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_jwt.go @@ -57,9 +57,11 @@ 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: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 d12a1f3c..2bf626d2 100644 --- a/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go +++ b/generated/1.20/apis/concierge/authentication/v1alpha1/types_webhook.go @@ -29,9 +29,11 @@ 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: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 f462056d..63d59446 100644 --- a/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go +++ b/generated/1.20/apis/concierge/config/v1alpha1/types_credentialissuer.go @@ -67,13 +67,16 @@ 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 +// +kubebuilder:resource:categories=pinniped,scope=Cluster +// +kubebuilder:subresource:status type CredentialIssuer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Status of the credential issuer. + // +optional Status CredentialIssuerStatus `json:"status"` } 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/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/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 } 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..9f5ec0fc 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 @@ -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 d31bae12..3ccd3216 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 @@ -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 9b4c0056..900db6cb 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: @@ -98,11 +98,11 @@ spec: required: - strategies type: object - required: - - status 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: "" diff --git a/hack/lib/tilt/Tiltfile b/hack/lib/tilt/Tiltfile index f97b8e5c..f7c6d5fa 100644 --- a/hack/lib/tilt/Tiltfile +++ b/hack/lib/tilt/Tiltfile @@ -152,7 +152,7 @@ k8s_yaml(local([ '--data-value namespace=concierge ' + '--data-value image_repo=image/concierge ' + '--data-value image_tag=tilt-dev ' + - '--data-value kube_cert_agent_image=debian:10.7-slim ' + + '--data-value kube_cert_agent_image=debian:10.8-slim ' + '--data-value discovery_url=$(TERM=dumb kubectl cluster-info | awk \'/master|control plane/ {print $NF}\') ' + '--data-value log_level=debug ' + '--data-value-yaml replicas=1 ' + diff --git a/hack/lib/tilt/concierge.Dockerfile b/hack/lib/tilt/concierge.Dockerfile index e9daadd6..7bbdd820 100644 --- a/hack/lib/tilt/concierge.Dockerfile +++ b/hack/lib/tilt/concierge.Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # Use a runtime image based on Debian slim -FROM debian:10.7-slim +FROM debian:10.8-slim # Copy the binary which was built outside the container. COPY build/pinniped-concierge /usr/local/bin/pinniped-concierge diff --git a/hack/lib/tilt/local-user-authenticator.Dockerfile b/hack/lib/tilt/local-user-authenticator.Dockerfile index 6b8430f6..b2e98da5 100644 --- a/hack/lib/tilt/local-user-authenticator.Dockerfile +++ b/hack/lib/tilt/local-user-authenticator.Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # Use a runtime image based on Debian slim -FROM debian:10.7-slim +FROM debian:10.8-slim # Copy the binary which was built outside the container. COPY build/local-user-authenticator /usr/local/bin/local-user-authenticator diff --git a/hack/lib/tilt/supervisor.Dockerfile b/hack/lib/tilt/supervisor.Dockerfile index 916d009a..94e382cd 100644 --- a/hack/lib/tilt/supervisor.Dockerfile +++ b/hack/lib/tilt/supervisor.Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # Use a runtime image based on Debian slim -FROM debian:10.7-slim +FROM debian:10.8-slim RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* 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/concierge/impersonator/impersonator_test.go b/internal/concierge/impersonator/impersonator_test.go index bf1c5981..72f38e17 100644 --- a/internal/concierge/impersonator/impersonator_test.go +++ b/internal/concierge/impersonator/impersonator_test.go @@ -191,7 +191,7 @@ func TestImpersonator(t *testing.T) { cacheWithMockAuthenticator := authncache.New() ctrl := gomock.NewController(t) defer ctrl.Finish() - key := authncache.Key{Namespace: "foo", Name: "authenticator-one"} + key := authncache.Key{Name: "authenticator-one"} mockToken := mocktokenauthenticator.NewMockToken(ctrl) cacheWithMockAuthenticator.Store(key, mockToken) 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 71614492..edbaca85 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 @@ -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 17b8073d..9d3c342f 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, }, @@ -367,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 f729a07c..732f1a89 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 @@ -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 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..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,18 +17,17 @@ import ( pinnipedclientset "go.pinniped.dev/generated/1.20/client/concierge/clientset/versioned" ) -func CreateOrUpdateCredentialIssuer( +func CreateOrUpdateCredentialIssuerStatus( ctx context.Context, - credentialIssuerNamespace string, 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. ConfigV1alpha1(). - CredentialIssuers(credentialIssuerNamespace). + CredentialIssuers(). Get(ctx, credentialIssuerResourceName, metav1.GetOptions{}) notFound := k8serrors.IsNotFound(err) @@ -36,32 +35,33 @@ 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, - ) - 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 }) @@ -73,19 +73,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, - }, - Status: configv1alpha1.CredentialIssuerStatus{ - Strategies: []configv1alpha1.CredentialIssuerStrategy{}, - KubeConfigInfo: nil, + Name: credentialIssuerName, + Labels: credentialIssuerLabels, }, } } 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..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,13 +23,12 @@ 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 var pinnipedAPIClient *pinnipedfake.Clientset var credentialIssuerGVR schema.GroupVersionResource - const installationNamespace = "some-namespace" const credentialIssuerResourceName = "some-resource-name" it.Before(func() { @@ -44,41 +43,50 @@ 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, - installationNamespace, credentialIssuerResourceName, map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", }, pinnipedAPIClient, - func(configToUpdate *configv1alpha1.CredentialIssuer) { - configToUpdate.Status.KubeConfigInfo = &configv1alpha1.CredentialIssuerKubeConfigInfo{ + func(configToUpdate *configv1alpha1.CredentialIssuerStatus) { + configToUpdate.KubeConfigInfo = &configv1alpha1.CredentialIssuerKubeConfigInfo{ CertificateAuthorityData: "some-ca-value", } }, ) 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", + }, + }, + }, + ) + + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", + &configv1alpha1.CredentialIssuer{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{ + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", }, }, Status: configv1alpha1.CredentialIssuerStatus{ - Strategies: []configv1alpha1.CredentialIssuerStrategy{}, KubeConfigInfo: &configv1alpha1.CredentialIssuerKubeConfigInfo{ Server: "", CertificateAuthorityData: "some-ca-value", @@ -87,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() { @@ -98,13 +106,12 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("returns an error", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, - installationNamespace, 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") }) @@ -118,8 +125,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", }, @@ -144,50 +150,48 @@ 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, - installationNamespace, credentialIssuerResourceName, map[string]string{ "myLabelKey1": "myLabelValue1", "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) - 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.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, - installationNamespace, 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) - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, installationNamespace, credentialIssuerResourceName) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) r.Equal([]coretesting.Action{expectedGetAction}, pinnipedAPIClient.Actions()) }) @@ -199,13 +203,12 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("returns an error", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, - installationNamespace, 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") }) @@ -219,14 +222,13 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("returns an error", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, - installationNamespace, 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") @@ -246,7 +248,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, @@ -258,33 +260,32 @@ func TestCreateOrUpdateCredentialIssuer(t *testing.T) { }) it("retries updates on conflict", func() { - err := CreateOrUpdateCredentialIssuer( + err := CreateOrUpdateCredentialIssuerStatus( ctx, - installationNamespace, credentialIssuerResourceName, map[string]string{ "myLabelKey1": "myLabelValue1", "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) - 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.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.NewUpdateAction(credentialIssuerGVR, installationNamespace, 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 b782c08b..494a6376 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( @@ -107,16 +104,15 @@ 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.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..bea11703 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,30 +115,39 @@ 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, *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, - Namespace: expectedNamespace, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", }, }, 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 @@ -149,7 +155,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", @@ -222,18 +227,21 @@ func TestSync(t *testing.T) { err := controllerlib.TestSync(t, subject, *syncContext) r.NoError(err) - expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( - installedInNamespace, + expectedCredentialIssuerGVR, expectedCreateCredentialIssuer, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) r.Equal( []coretesting.Action{ - coretesting.NewGetAction(expectedCredentialIssuerGVR, installedInNamespace, expectedCredentialIssuer.Name), - coretesting.NewCreateAction( + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCreateCredentialIssuer.Name), + coretesting.NewRootCreateAction( expectedCredentialIssuerGVR, - installedInNamespace, + expectedCreateCredentialIssuer, + ), + coretesting.NewRootUpdateSubresourceAction( + expectedCredentialIssuerGVR, + "status", expectedCredentialIssuer, ), }, @@ -268,8 +276,7 @@ func TestSync(t *testing.T) { err := controllerlib.TestSync(t, subject, *syncContext) r.NoError(err) - expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( - installedInNamespace, + expectedCredentialIssuerGVR, expectedCreateCredentialIssuer, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) @@ -277,10 +284,14 @@ func TestSync(t *testing.T) { r.Equal( []coretesting.Action{ - coretesting.NewGetAction(expectedCredentialIssuerGVR, installedInNamespace, expectedCredentialIssuer.Name), - coretesting.NewCreateAction( + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCreateCredentialIssuer.Name), + coretesting.NewRootCreateAction( expectedCredentialIssuerGVR, - installedInNamespace, + expectedCreateCredentialIssuer, + ), + coretesting.NewRootUpdateSubresourceAction( + expectedCredentialIssuerGVR, + "status", expectedCredentialIssuer, ), }, @@ -296,8 +307,7 @@ func TestSync(t *testing.T) { var credentialIssuer *configv1alpha1.CredentialIssuer it.Before(func() { - credentialIssuerGVR, credentialIssuer = expectedCredentialIssuer( - installedInNamespace, + credentialIssuerGVR, _, credentialIssuer = expectedCredentialIssuer( kubeServerURL, caData, ) @@ -312,7 +322,7 @@ func TestSync(t *testing.T) { r.Equal( []coretesting.Action{ - coretesting.NewGetAction(credentialIssuerGVR, installedInNamespace, credentialIssuer.Name), + coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuer.Name), }, pinnipedAPIClient.Actions(), ) @@ -321,8 +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( - installedInNamespace, + _, _, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) @@ -335,16 +344,15 @@ func TestSync(t *testing.T) { err := controllerlib.TestSync(t, subject, *syncContext) r.NoError(err) - expectedCredentialIssuerGVR, expectedCredentialIssuer := expectedCredentialIssuer( - installedInNamespace, + expectedCredentialIssuerGVR, _, expectedCredentialIssuer := expectedCredentialIssuer( kubeServerURL, caData, ) expectedActions := []coretesting.Action{ - coretesting.NewGetAction(expectedCredentialIssuerGVR, installedInNamespace, expectedCredentialIssuer.Name), - coretesting.NewUpdateAction( + coretesting.NewRootGetAction(expectedCredentialIssuerGVR, expectedCredentialIssuer.Name), + coretesting.NewRootUpdateSubresourceAction( expectedCredentialIssuerGVR, - installedInNamespace, + "status", expectedCredentialIssuer, ), } diff --git a/internal/controller/kubecertagent/annotater_test.go b/internal/controller/kubecertagent/annotater_test.go index 1674700f..f59fe1a3 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,13 @@ func TestAnnotaterControllerSync(t *testing.T) { LastUpdateTime: metav1.NewTime(frozenNow), }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( credentialIssuerGVR, - credentialIssuerNamespaceName, + "status", expectedCredentialIssuer, ) @@ -309,11 +305,17 @@ 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{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -327,14 +329,17 @@ func TestAnnotaterControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedCreateAction := coretesting.NewCreateAction( + expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, + expectedCreateCredentialIssuer, + ) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( + credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -343,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 70643f85..e9592519 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,13 @@ func TestCreaterControllerSync(t *testing.T) { LastUpdateTime: metav1.NewTime(frozenNow), }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( credentialIssuerGVR, - credentialIssuerNamespaceName, + "status", expectedCredentialIssuer, ) @@ -380,11 +376,21 @@ 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{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", @@ -402,14 +408,17 @@ func TestCreaterControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedCreateAction := coretesting.NewCreateAction( + expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, + expectedCreateCredentialIssuer, + ) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( + credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -418,6 +427,7 @@ func TestCreaterControllerSync(t *testing.T) { []coretesting.Action{ expectedGetAction, expectedCreateAction, + expectedUpdateAction, }, pinnipedAPIClient.Actions(), ) @@ -435,8 +445,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 +472,13 @@ func TestCreaterControllerSync(t *testing.T) { LastUpdateTime: metav1.NewTime(frozenNow), }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedUpdateAction := coretesting.NewUpdateAction( + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( credentialIssuerGVR, - credentialIssuerNamespaceName, + "status", expectedCredentialIssuer, ) @@ -525,11 +533,21 @@ 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{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, Labels: map[string]string{ "myLabelKey1": "myLabelValue1", "myLabelKey2": "myLabelValue2", @@ -547,14 +565,17 @@ func TestCreaterControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction( + expectedGetAction := coretesting.NewRootGetAction( credentialIssuerGVR, - credentialIssuerNamespaceName, credentialIssuerResourceName, ) - expectedCreateAction := coretesting.NewCreateAction( + expectedCreateAction := coretesting.NewRootCreateAction( credentialIssuerGVR, - credentialIssuerNamespaceName, + expectedCreateCredentialIssuer, + ) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction( + credentialIssuerGVR, + "status", expectedCredentialIssuer, ) @@ -563,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 8ca37e25..5b3d8d58 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.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedCredentialIssuer) r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) }) @@ -393,11 +389,17 @@ 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{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -411,9 +413,10 @@ func TestManagerControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, credentialIssuerNamespaceName, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewCreateAction(credentialIssuerGVR, credentialIssuerNamespaceName, expectedCredentialIssuer) - r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCreateCredentialIssuer) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedCredentialIssuer) + r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) }) }) @@ -436,11 +439,17 @@ 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{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -454,9 +463,10 @@ func TestManagerControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, credentialIssuerNamespaceName, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewCreateAction(credentialIssuerGVR, credentialIssuerNamespaceName, expectedCredentialIssuer) - r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) + expectedCreateAction := coretesting.NewRootCreateAction(credentialIssuerGVR, expectedCreateCredentialIssuer) + expectedUpdateAction := coretesting.NewRootUpdateSubresourceAction(credentialIssuerGVR, "status", expectedCredentialIssuer) + r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction, expectedUpdateAction}, pinnipedAPIClient.Actions()) }) }) @@ -478,11 +488,17 @@ 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{ - Name: credentialIssuerResourceName, - Namespace: credentialIssuerNamespaceName, + Name: credentialIssuerResourceName, }, Status: configv1alpha1.CredentialIssuerStatus{ Strategies: []configv1alpha1.CredentialIssuerStrategy{ @@ -496,9 +512,10 @@ func TestManagerControllerSync(t *testing.T) { }, }, } - expectedGetAction := coretesting.NewGetAction(credentialIssuerGVR, credentialIssuerNamespaceName, credentialIssuerResourceName) - expectedCreateAction := coretesting.NewCreateAction(credentialIssuerGVR, credentialIssuerNamespaceName, expectedCredentialIssuer) - r.Equal([]coretesting.Action{expectedGetAction, expectedCreateAction}, pinnipedAPIClient.Actions()) + expectedGetAction := coretesting.NewRootGetAction(credentialIssuerGVR, credentialIssuerResourceName) + 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 cb32d0b3..0122a5d4 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 } @@ -290,20 +287,19 @@ func createOrUpdateCredentialIssuer(ctx context.Context, pinnipedAPIClient pinnipedclientset.Interface, err error, ) error { - return issuerconfig.CreateOrUpdateCredentialIssuer( + return issuerconfig.CreateOrUpdateCredentialIssuerStatus( ctx, - ciConfig.Namespace, 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/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), }, }, { diff --git a/internal/controllermanager/prepare_controllers.go b/internal/controllermanager/prepare_controllers.go index cbc3f069..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 { @@ -109,16 +122,9 @@ 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) - 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(). @@ -127,7 +133,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 +250,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 +258,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 +266,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 +281,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 +309,9 @@ func createInformers( defaultResyncInterval, k8sinformers.WithNamespace(serverInstallationNamespace), ), - installationNamespacePinniped: pinnipedinformers.NewSharedInformerFactoryWithOptions( + pinniped: pinnipedinformers.NewSharedInformerFactoryWithOptions( pinnipedClient, defaultResyncInterval, - pinnipedinformers.WithNamespace(serverInstallationNamespace), ), } } @@ -316,10 +320,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/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/internal/groupsuffix/groupsuffix.go b/internal/groupsuffix/groupsuffix.go index 39f556a7..d080662a 100644 --- a/internal/groupsuffix/groupsuffix.go +++ b/internal/groupsuffix/groupsuffix.go @@ -5,6 +5,7 @@ package groupsuffix import ( "context" + "fmt" "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -12,8 +13,10 @@ import ( "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/validation" + loginv1alpha1 "go.pinniped.dev/generated/1.20/apis/concierge/login/v1alpha1" "go.pinniped.dev/internal/constable" "go.pinniped.dev/internal/kubeclient" + "go.pinniped.dev/internal/plog" ) const ( @@ -35,7 +38,7 @@ func New(apiGroupSuffix string) kubeclient.Middleware { return // ignore APIs that do not have our group } - rt.MutateRequest(func(obj kubeclient.Object) { + rt.MutateRequest(func(obj kubeclient.Object) error { typeMeta := obj.GetObjectKind() origGVK := typeMeta.GroupVersionKind() newGVK := schema.GroupVersionKind{ @@ -44,6 +47,7 @@ func New(apiGroupSuffix string) kubeclient.Middleware { Kind: origGVK.Kind, } typeMeta.SetGroupVersionKind(newGVK) + return nil }) }), @@ -61,6 +65,49 @@ func New(apiGroupSuffix string) kubeclient.Middleware { rt.MutateRequest(mutateOwnerRefs(Replace, apiGroupSuffix)) }), + kubeclient.MiddlewareFunc(func(_ context.Context, rt kubeclient.RoundTrip) { + // we only care if this is a create on a TokenCredentialRequest without a subresource + if rt.Resource() != loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests") || + rt.Verb() != kubeclient.VerbCreate || + rt.Subresource() != "" { + return + } + + // we only do this on the way out, since on the way back in we don't set a spec in our + // TokenCredentialRequest + rt.MutateRequest(func(obj kubeclient.Object) error { + tokenCredentialRequest, ok := obj.(*loginv1alpha1.TokenCredentialRequest) + if !ok { + return fmt.Errorf("cannot cast obj of type %T to *loginv1alpha1.TokenCredentialRequest", obj) + } + + if tokenCredentialRequest.Spec.Authenticator.APIGroup == nil { + // technically, the APIGroup field is optional, so clients are free to do this, but we + // want our middleware to be opinionated so that it can be really good at a specific task + // and give us specific feedback when it can't do that specific task + return fmt.Errorf( + "cannot replace token credential request %q without authenticator API group", + plog.KObj(obj), + ) + } + + mutatedAuthenticatorAPIGroup, ok := Replace(*tokenCredentialRequest.Spec.Authenticator.APIGroup, apiGroupSuffix) + if !ok { + // see comment above about specificity of middleware + return fmt.Errorf( + "cannot replace token credential request %q authenticator API group %q with group suffix %q", + plog.KObj(obj), + *tokenCredentialRequest.Spec.Authenticator.APIGroup, + apiGroupSuffix, + ) + } + + tokenCredentialRequest.Spec.Authenticator.APIGroup = &mutatedAuthenticatorAPIGroup + + return nil + }) + }), + kubeclient.MiddlewareFunc(func(_ context.Context, rt kubeclient.RoundTrip) { // always unreplace owner refs with apiGroupSuffix because we can consume those objects across all verbs rt.MutateResponse(mutateOwnerRefs(Unreplace, apiGroupSuffix)) @@ -68,12 +115,12 @@ func New(apiGroupSuffix string) kubeclient.Middleware { } } -func mutateOwnerRefs(replaceFunc func(baseAPIGroup, apiGroupSuffix string) (string, bool), apiGroupSuffix string) func(kubeclient.Object) { - return func(obj kubeclient.Object) { +func mutateOwnerRefs(replaceFunc func(baseAPIGroup, apiGroupSuffix string) (string, bool), apiGroupSuffix string) func(kubeclient.Object) error { + return func(obj kubeclient.Object) error { // fix up owner refs because they are consumed by external and internal actors oldRefs := obj.GetOwnerReferences() if len(oldRefs) == 0 { - return + return nil } var changedGroup bool @@ -94,10 +141,12 @@ func mutateOwnerRefs(replaceFunc func(baseAPIGroup, apiGroupSuffix string) (stri } if !changedGroup { - return + return nil } obj.SetOwnerReferences(newRefs) + + return nil } } diff --git a/internal/groupsuffix/groupsuffix_test.go b/internal/groupsuffix/groupsuffix_test.go index f9c599e0..e9e2036b 100644 --- a/internal/groupsuffix/groupsuffix_test.go +++ b/internal/groupsuffix/groupsuffix_test.go @@ -14,6 +14,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + authv1alpha1 "go.pinniped.dev/generated/1.20/apis/concierge/authentication/v1alpha1" loginv1alpha1 "go.pinniped.dev/generated/1.20/apis/concierge/login/v1alpha1" configv1alpha1 "go.pinniped.dev/generated/1.20/apis/supervisor/config/v1alpha1" "go.pinniped.dev/internal/kubeclient" @@ -31,6 +32,7 @@ func ExampleReplace_string() { fmt.Println(s) // Output: idp.supervisor.marlin.io } + func TestMiddlware(t *testing.T) { const newSuffix = "some.suffix.com" @@ -117,14 +119,14 @@ func TestMiddlware(t *testing.T) { }, }, } - federationDomainWithPinnipedOwnerWithNewGroup := &configv1alpha1.FederationDomain{ + federationDomainWithNewGroupAndPinnipedOwner := &configv1alpha1.FederationDomain{ TypeMeta: metav1.TypeMeta{ - APIVersion: configv1alpha1.SchemeGroupVersion.String(), + APIVersion: replaceGV(t, configv1alpha1.SchemeGroupVersion, newSuffix).String(), Kind: "FederationDomain", }, ObjectMeta: metav1.ObjectMeta{ OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(pinnipedOwner, pinnipedOwnerWithNewGroupGVK), + *metav1.NewControllerRef(pinnipedOwner, pinnipedOwnerGVK), // make sure we don't update the non-pinniped owner *metav1.NewControllerRef(nonPinnipedOwner, nonPinnipedOwnerGVK), @@ -133,7 +135,7 @@ func TestMiddlware(t *testing.T) { } federationDomainWithNewGroupAndPinnipedOwnerWithNewGroup := &configv1alpha1.FederationDomain{ TypeMeta: metav1.TypeMeta{ - APIVersion: replaceGV(t, configv1alpha1.SchemeGroupVersion, newSuffix), + APIVersion: replaceGV(t, configv1alpha1.SchemeGroupVersion, newSuffix).String(), Kind: "FederationDomain", }, ObjectMeta: metav1.ObjectMeta{ @@ -146,29 +148,40 @@ func TestMiddlware(t *testing.T) { }, } - tokenCredentialRequest := &loginv1alpha1.TokenCredentialRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: loginv1alpha1.SchemeGroupVersion.String(), - Kind: "TokenCredentialRequest", - }, - } - tokenCredentialRequestWithNewGroup := &loginv1alpha1.TokenCredentialRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: replaceGV(t, loginv1alpha1.SchemeGroupVersion, newSuffix), - Kind: "TokenCredentialRequest", - }, - } + tokenCredentialRequest := with( + &loginv1alpha1.TokenCredentialRequest{}, + gvk(replaceGV(t, loginv1alpha1.SchemeGroupVersion, newSuffix).WithKind("TokenCredentialRequest")), + ) + tokenCredentialRequestWithPinnipedAuthenticator := with( + tokenCredentialRequest, + authenticatorAPIGroup(authv1alpha1.SchemeGroupVersion.Group), + ) + tokenCredentialRequestWithCustomAPIGroupAuthenticator := with( + tokenCredentialRequest, + authenticatorAPIGroup(replaceGV(t, authv1alpha1.SchemeGroupVersion, newSuffix).Group), + ) + tokenCredentialRequestWithNewGroup := with( + tokenCredentialRequest, + gvk(replaceGV(t, loginv1alpha1.SchemeGroupVersion, newSuffix).WithKind("TokenCredentialRequest")), + ) + tokenCredentialRequestWithNewGroupAndPinnipedAuthenticator := with( + tokenCredentialRequestWithNewGroup, + authenticatorAPIGroup(authv1alpha1.SchemeGroupVersion.Group), + ) + tokenCredentialRequestWithNewGroupAndCustomAPIGroupAuthenticator := with( + tokenCredentialRequestWithNewGroup, + authenticatorAPIGroup(replaceGV(t, authv1alpha1.SchemeGroupVersion, newSuffix).Group), + ) tests := []struct { - name string - apiGroupSuffix string - rt *testutil.RoundTrip - requestObj, responseObj kubeclient.Object - wantNilMiddleware bool - wantMutateRequests, wantMutateResponses int - wantRequestObj, wantResponseObj kubeclient.Object - - skip bool + name string + apiGroupSuffix string + rt *testutil.RoundTrip + requestObj, responseObj kubeclient.Object + wantNilMiddleware bool + wantMutateRequests, wantMutateResponses int + wantMutateRequestErrors, wantMutateResponseErrors []string + wantRequestObj, wantResponseObj kubeclient.Object }{ { name: "api group suffix is empty", @@ -227,12 +240,12 @@ func TestMiddlware(t *testing.T) { rt: (&testutil.RoundTrip{}). WithVerb(kubeclient.VerbGet). WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), - requestObj: tokenCredentialRequest, - responseObj: tokenCredentialRequest, + requestObj: with(&metav1.PartialObjectMetadata{}, gvk(loginv1alpha1.SchemeGroupVersion.WithKind("TokenCredentialRequest"))), + responseObj: tokenCredentialRequestWithNewGroup, wantMutateRequests: 1, wantMutateResponses: 1, - wantRequestObj: tokenCredentialRequestWithNewGroup, - wantResponseObj: tokenCredentialRequest, + wantRequestObj: with(&metav1.PartialObjectMetadata{}, gvk(replaceGV(t, loginv1alpha1.SchemeGroupVersion, newSuffix).WithKind("TokenCredentialRequest"))), + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us }, { name: "create resource without pinniped.dev and without owner ref", @@ -289,7 +302,7 @@ func TestMiddlware(t *testing.T) { wantResponseObj: podWithPinnipedOwner, }, { - // test that both of our middleware request mutations play nicely with each other + // test that multiple of our middleware request mutations play nicely with each other name: "create resource with pinniped.dev and with owner ref that has pinniped.dev owner", apiGroupSuffix: newSuffix, rt: (&testutil.RoundTrip{}). @@ -297,11 +310,11 @@ func TestMiddlware(t *testing.T) { WithNamespace("some-namespace"). WithResource(configv1alpha1.SchemeGroupVersion.WithResource("federationdomains")), requestObj: federationDomainWithPinnipedOwner, - responseObj: federationDomainWithPinnipedOwnerWithNewGroup, + responseObj: federationDomainWithNewGroupAndPinnipedOwnerWithNewGroup, wantMutateRequests: 2, wantMutateResponses: 1, wantRequestObj: federationDomainWithNewGroupAndPinnipedOwnerWithNewGroup, - wantResponseObj: federationDomainWithPinnipedOwner, + wantResponseObj: federationDomainWithNewGroupAndPinnipedOwner, // the middleware will reset object GVK for us }, { name: "update resource without pinniped.dev", @@ -321,11 +334,11 @@ func TestMiddlware(t *testing.T) { WithVerb(kubeclient.VerbUpdate). WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), requestObj: tokenCredentialRequest, - responseObj: tokenCredentialRequest, + responseObj: tokenCredentialRequestWithNewGroup, wantMutateRequests: 1, wantMutateResponses: 1, wantRequestObj: tokenCredentialRequestWithNewGroup, - wantResponseObj: tokenCredentialRequest, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us }, { name: "list resource without pinniped.dev", @@ -345,11 +358,11 @@ func TestMiddlware(t *testing.T) { WithVerb(kubeclient.VerbList). WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), requestObj: tokenCredentialRequest, - responseObj: tokenCredentialRequest, + responseObj: tokenCredentialRequestWithNewGroup, wantMutateRequests: 1, wantMutateResponses: 1, wantRequestObj: tokenCredentialRequestWithNewGroup, - wantResponseObj: tokenCredentialRequest, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us }, { name: "watch resource without pinniped.dev", @@ -369,11 +382,11 @@ func TestMiddlware(t *testing.T) { WithVerb(kubeclient.VerbList). WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), requestObj: tokenCredentialRequest, - responseObj: tokenCredentialRequest, + responseObj: tokenCredentialRequestWithNewGroup, wantMutateRequests: 1, wantMutateResponses: 1, wantRequestObj: tokenCredentialRequestWithNewGroup, - wantResponseObj: tokenCredentialRequest, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us }, { name: "patch resource without pinniped.dev", @@ -390,23 +403,98 @@ func TestMiddlware(t *testing.T) { name: "patch resource with pinniped.dev", apiGroupSuffix: newSuffix, rt: (&testutil.RoundTrip{}). - WithVerb(kubeclient.VerbList). + WithVerb(kubeclient.VerbPatch). WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), requestObj: tokenCredentialRequest, - responseObj: tokenCredentialRequest, + responseObj: tokenCredentialRequestWithNewGroup, wantMutateRequests: 1, wantMutateResponses: 1, wantRequestObj: tokenCredentialRequestWithNewGroup, - wantResponseObj: tokenCredentialRequest, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us + }, + { + name: "create tokencredentialrequest with pinniped.dev authenticator api group", + apiGroupSuffix: newSuffix, + rt: (&testutil.RoundTrip{}). + WithVerb(kubeclient.VerbCreate). + WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), + requestObj: tokenCredentialRequestWithPinnipedAuthenticator, + responseObj: tokenCredentialRequestWithNewGroup, // a token credential response does not contain a spec + wantMutateRequests: 3, + wantMutateResponses: 1, + wantRequestObj: tokenCredentialRequestWithNewGroupAndCustomAPIGroupAuthenticator, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us + }, + { + name: "create tokencredentialrequest with custom authenticator api group fails because api group is expected to be pinniped.dev", + apiGroupSuffix: newSuffix, + rt: (&testutil.RoundTrip{}). + WithVerb(kubeclient.VerbCreate). + WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), + requestObj: tokenCredentialRequestWithCustomAPIGroupAuthenticator, + responseObj: tokenCredentialRequestWithNewGroup, // a token credential response does not contain a spec + wantMutateRequests: 3, + wantMutateResponses: 1, + wantMutateRequestErrors: []string{`cannot replace token credential request "/" authenticator API group "authentication.concierge.some.suffix.com" with group suffix "some.suffix.com"`}, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us + }, + { + name: "create tokencredentialrequest with pinniped.dev authenticator api group and subresource", + apiGroupSuffix: newSuffix, + rt: (&testutil.RoundTrip{}). + WithVerb(kubeclient.VerbCreate). + WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")). + WithSubresource("some-subresource"), + requestObj: tokenCredentialRequestWithPinnipedAuthenticator, + responseObj: tokenCredentialRequestWithNewGroup, // a token credential response does not contain a spec + wantMutateRequests: 1, + wantMutateResponses: 1, + wantRequestObj: tokenCredentialRequestWithNewGroupAndPinnipedAuthenticator, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us + }, + { + name: "non-create tokencredentialrequest with pinniped.dev authenticator api group", + apiGroupSuffix: newSuffix, + rt: (&testutil.RoundTrip{}). + WithVerb(kubeclient.VerbList). + WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), + requestObj: tokenCredentialRequestWithPinnipedAuthenticator, + responseObj: tokenCredentialRequestWithNewGroup, // a token credential response does not contain a spec + wantMutateRequests: 1, + wantMutateResponses: 1, + wantRequestObj: tokenCredentialRequestWithNewGroupAndPinnipedAuthenticator, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us + }, + { + name: "create tokencredentialrequest with nil authenticator api group", + apiGroupSuffix: newSuffix, + rt: (&testutil.RoundTrip{}). + WithVerb(kubeclient.VerbCreate). + WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), + requestObj: tokenCredentialRequest, + responseObj: tokenCredentialRequestWithNewGroup, // a token credential response does not contain a spec + wantMutateRequests: 3, + wantMutateResponses: 1, + wantMutateRequestErrors: []string{`cannot replace token credential request "/" without authenticator API group`}, + wantResponseObj: tokenCredentialRequestWithNewGroup, // the middleware will reset object GVK for us + }, + { + name: "create tokencredentialrequest with non-*loginv1alpha1.TokenCredentialRequest", + apiGroupSuffix: newSuffix, + rt: (&testutil.RoundTrip{}). + WithVerb(kubeclient.VerbCreate). + WithResource(loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests")), + requestObj: podWithoutOwner, + responseObj: podWithoutOwner, + wantMutateRequests: 3, + wantMutateResponses: 1, + wantMutateRequestErrors: []string{`cannot cast obj of type *v1.Pod to *loginv1alpha1.TokenCredentialRequest`}, + wantResponseObj: podWithoutOwner, }, } for _, test := range tests { test := test t.Run(test.name, func(t *testing.T) { - if test.skip { - t.Skip() - } - m := New(test.apiGroupSuffix) if test.wantNilMiddleware { require.Nil(t, m, "wanted nil middleware") @@ -414,27 +502,41 @@ func TestMiddlware(t *testing.T) { } m.Handle(context.Background(), test.rt) - require.Len(t, test.rt.MutateRequests, test.wantMutateRequests) - require.Len(t, test.rt.MutateResponses, test.wantMutateResponses) + require.Len(t, test.rt.MutateRequests, test.wantMutateRequests, "undesired request mutation count") + require.Len(t, test.rt.MutateResponses, test.wantMutateResponses, "undesired response mutation count") if test.wantMutateRequests != 0 { require.NotNil(t, test.requestObj, "expected test.requestObj to be set") objMutated := test.requestObj.DeepCopyObject().(kubeclient.Object) + var mutateRequestErrors []string for _, mutateRequest := range test.rt.MutateRequests { mutateRequest := mutateRequest - mutateRequest(objMutated) + if err := mutateRequest(objMutated); err != nil { + mutateRequestErrors = append(mutateRequestErrors, err.Error()) + } + } + if len(test.wantMutateRequestErrors) > 0 { + require.Equal(t, test.wantMutateRequestErrors, mutateRequestErrors, "mutate request errors did not match") + } else { + require.Equal(t, test.wantRequestObj, objMutated, "request obj did not match") } - require.Equal(t, test.wantRequestObj, objMutated, "request obj did not match") } if test.wantMutateResponses != 0 { require.NotNil(t, test.responseObj, "expected test.responseObj to be set") objMutated := test.responseObj.DeepCopyObject().(kubeclient.Object) + var mutateResponseErrors []string for _, mutateResponse := range test.rt.MutateResponses { mutateResponse := mutateResponse - mutateResponse(objMutated) + if err := mutateResponse(objMutated); err != nil { + mutateResponseErrors = append(mutateResponseErrors, err.Error()) + } + } + if len(test.wantMutateRequestErrors) > 0 { + require.Equal(t, test.wantMutateResponseErrors, mutateResponseErrors, "mutate response errors did not match") + } else { + require.Equal(t, test.wantResponseObj, objMutated, "response obj did not match") } - require.Equal(t, test.wantResponseObj, objMutated, "response obj did not match") } }) } @@ -519,11 +621,35 @@ func TestValidate(t *testing.T) { } } -func replaceGV(t *testing.T, baseGV schema.GroupVersion, apiGroupSuffix string) string { +type withFunc func(obj kubeclient.Object) + +func with(obj kubeclient.Object, withFuncs ...withFunc) kubeclient.Object { + obj = obj.DeepCopyObject().(kubeclient.Object) + for _, withFunc := range withFuncs { + withFunc(obj) + } + return obj +} + +func gvk(gvk schema.GroupVersionKind) withFunc { + return func(obj kubeclient.Object) { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } +} + +func authenticatorAPIGroup(apiGroup string) withFunc { + return func(obj kubeclient.Object) { + tokenCredentialRequest := obj.(*loginv1alpha1.TokenCredentialRequest) + tokenCredentialRequest.Spec.Authenticator.APIGroup = &apiGroup + } +} + +//nolint:unparam // the apiGroupSuffix parameter might always be the same, but this is nice for test readability +func replaceGV(t *testing.T, baseGV schema.GroupVersion, apiGroupSuffix string) schema.GroupVersion { t.Helper() groupName, ok := Replace(baseGV.Group, apiGroupSuffix) require.True(t, ok, "expected to be able to replace %q's suffix with %q", baseGV.Group, apiGroupSuffix) - return schema.GroupVersion{Group: groupName, Version: baseGV.Version}.String() + return schema.GroupVersion{Group: groupName, Version: baseGV.Version} } func chars(count int) string { diff --git a/internal/kubeclient/kubeclient_test.go b/internal/kubeclient/kubeclient_test.go index 2bb4aaee..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) }, @@ -492,8 +492,9 @@ func TestKubeclient(t *testing.T) { return []*spyMiddleware{{ name: "non-pertinent mutater", t: t, - mutateReq: func(rt RoundTrip, obj Object) { + mutateReq: func(rt RoundTrip, obj Object) error { clusterName()(obj) + return nil }, }} }, @@ -529,6 +530,64 @@ func TestKubeclient(t *testing.T) { wantMiddlewareReqs: [][]Object{{with(&metav1.PartialObjectMetadata{}, gvk(federationDomainGVK))}}, wantMiddlewareResps: [][]Object{nil}, }, + { + name: "when there are request middleware failures, we return an error and don't send the request", + middlewares: func(t *testing.T) []*spyMiddleware { + return []*spyMiddleware{ + // use 3 middleware to ensure that we collect all errors from all middlewares + newFailingMiddleware(t, "aaa", true, false), + newFailingMiddleware(t, "bbb", false, false), + newFailingMiddleware(t, "ccc", true, false), + } + }, + reallyRunTest: func(t *testing.T, c *Client) { + _, err := c.PinnipedSupervisor. + ConfigV1alpha1(). + FederationDomains(goodFederationDomain.Namespace). + Get(context.Background(), goodFederationDomain.Name, metav1.GetOptions{}) + require.Error(t, err) + require.Contains(t, err.Error(), ": request mutation failed: [aaa: request error, ccc: request error]") + }, + wantMiddlewareReqs: [][]Object{ + {with(&metav1.PartialObjectMetadata{}, gvk(federationDomainGVK))}, + {with(&metav1.PartialObjectMetadata{}, gvk(federationDomainGVK))}, + {with(&metav1.PartialObjectMetadata{}, gvk(federationDomainGVK))}, + }, + wantMiddlewareResps: [][]Object{ + nil, + nil, + nil, + }, + }, + { + name: "when there are response middleware failures, we return an error", + middlewares: func(t *testing.T) []*spyMiddleware { + return []*spyMiddleware{ + // use 3 middleware to ensure that we collect all errors from all middlewares + newFailingMiddleware(t, "aaa", false, true), + newFailingMiddleware(t, "bbb", false, false), + newFailingMiddleware(t, "ccc", false, true), + } + }, + reallyRunTest: func(t *testing.T, c *Client) { + _, err := c.PinnipedSupervisor. + ConfigV1alpha1(). + FederationDomains(goodFederationDomain.Namespace). + Create(context.Background(), goodFederationDomain, metav1.CreateOptions{}) + require.Error(t, err) + require.Contains(t, err.Error(), ": response mutation failed: [aaa: response error, ccc: response error]") + }, + wantMiddlewareReqs: [][]Object{ + {with(goodFederationDomain, gvk(federationDomainGVK))}, + {with(goodFederationDomain, gvk(federationDomainGVK))}, + {with(goodFederationDomain, gvk(federationDomainGVK))}, + }, + wantMiddlewareResps: [][]Object{ + {with(goodFederationDomain, gvk(federationDomainGVK))}, + {with(goodFederationDomain, gvk(federationDomainGVK))}, + {with(goodFederationDomain, gvk(federationDomainGVK))}, + }, + }, } for _, test := range tests { test := test @@ -568,8 +627,8 @@ func TestKubeclient(t *testing.T) { type spyMiddleware struct { name string t *testing.T - mutateReq func(RoundTrip, Object) - mutateResp func(RoundTrip, Object) + mutateReq func(RoundTrip, Object) error + mutateResp func(RoundTrip, Object) error reqObjs []Object respObjs []Object } @@ -578,18 +637,18 @@ func (s *spyMiddleware) Handle(_ context.Context, rt RoundTrip) { s.t.Log(s.name, "handling", reqStr(rt, nil)) if s.mutateReq != nil { - rt.MutateRequest(func(obj Object) { + rt.MutateRequest(func(obj Object) error { s.t.Log(s.name, "mutating request", reqStr(rt, obj)) s.reqObjs = append(s.reqObjs, obj.DeepCopyObject().(Object)) - s.mutateReq(rt, obj) + return s.mutateReq(rt, obj) }) } if s.mutateResp != nil { - rt.MutateResponse(func(obj Object) { + rt.MutateResponse(func(obj Object) error { s.t.Log(s.name, "mutating response", reqStr(rt, obj)) s.respObjs = append(s.respObjs, obj.DeepCopyObject().(Object)) - s.mutateResp(rt, obj) + return s.mutateResp(rt, obj) }) } } @@ -611,17 +670,19 @@ func newAnnotationMiddleware(t *testing.T) *spyMiddleware { return &spyMiddleware{ name: "annotater", t: t, - mutateReq: func(rt RoundTrip, obj Object) { + mutateReq: func(rt RoundTrip, obj Object) error { if rt.Verb() == VerbCreate { annotations()(obj) } + return nil }, - mutateResp: func(rt RoundTrip, obj Object) { + mutateResp: func(rt RoundTrip, obj Object) error { if rt.Verb() == VerbCreate { for key := range middlewareAnnotations { delete(obj.GetAnnotations(), key) } } + return nil }, } } @@ -630,41 +691,69 @@ func newLabelMiddleware(t *testing.T) *spyMiddleware { return &spyMiddleware{ name: "labeler", t: t, - mutateReq: func(rt RoundTrip, obj Object) { + mutateReq: func(rt RoundTrip, obj Object) error { if rt.Verb() == VerbCreate { labels()(obj) } + return nil }, - mutateResp: func(rt RoundTrip, obj Object) { + mutateResp: func(rt RoundTrip, obj Object) error { if rt.Verb() == VerbCreate { for key := range middlewareLabels { delete(obj.GetLabels(), key) } } + return nil }, } } func newSimpleMiddleware(t *testing.T, hasMutateReqFunc, mutatedReq, hasMutateRespFunc bool) *spyMiddleware { m := &spyMiddleware{ - name: "nop", + name: "simple", t: t, } if hasMutateReqFunc { - m.mutateReq = func(rt RoundTrip, obj Object) { + m.mutateReq = func(rt RoundTrip, obj Object) error { if mutatedReq { if rt.Verb() == VerbCreate { obj.SetClusterName(someClusterName) } } + return nil } } if hasMutateRespFunc { - m.mutateResp = func(rt RoundTrip, obj Object) {} + m.mutateResp = func(rt RoundTrip, obj Object) error { + return nil + } } return m } +func newFailingMiddleware(t *testing.T, name string, mutateReqFails, mutateRespFails bool) *spyMiddleware { + m := &spyMiddleware{ + name: "failing-middleware-" + name, + t: t, + } + + m.mutateReq = func(rt RoundTrip, obj Object) error { + if mutateReqFails { + return fmt.Errorf("%s: request error", name) + } + return nil + } + + m.mutateResp = func(rt RoundTrip, obj Object) error { + if mutateRespFails { + return fmt.Errorf("%s: response error", name) + } + return nil + } + + return m +} + type wantCloser struct { io.ReadCloser closeCount int diff --git a/internal/kubeclient/middleware.go b/internal/kubeclient/middleware.go index 4c4a02be..f35b3532 100644 --- a/internal/kubeclient/middleware.go +++ b/internal/kubeclient/middleware.go @@ -12,6 +12,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/errors" ) type Middleware interface { @@ -43,8 +44,8 @@ type RoundTrip interface { NamespaceScoped() bool Resource() schema.GroupVersionResource Subresource() string - MutateRequest(f func(obj Object)) - MutateResponse(f func(obj Object)) + MutateRequest(f func(obj Object) error) + MutateResponse(f func(obj Object) error) } type Object interface { @@ -58,7 +59,7 @@ type request struct { verb Verb namespace string resource schema.GroupVersionResource - reqFuncs, respFuncs []func(obj Object) + reqFuncs, respFuncs []func(obj Object) error subresource string } @@ -89,11 +90,11 @@ func (r *request) Subresource() string { return r.subresource } -func (r *request) MutateRequest(f func(obj Object)) { +func (r *request) MutateRequest(f func(obj Object) error) { r.reqFuncs = append(r.reqFuncs, f) } -func (r *request) MutateResponse(f func(obj Object)) { +func (r *request) MutateResponse(f func(obj Object) error) { r.respFuncs = append(r.respFuncs, f) } @@ -113,9 +114,15 @@ func (r *request) mutateRequest(obj Object) (*mutationResult, error) { return nil, fmt.Errorf("invalid deep copy semantics for %T: %#v", obj, r) } + var errs []error for _, reqFunc := range r.reqFuncs { reqFunc := reqFunc - reqFunc(obj) + if err := reqFunc(obj); err != nil { + errs = append(errs, err) + } + } + if err := errors.NewAggregate(errs); err != nil { + return nil, fmt.Errorf("request mutation failed: %w", err) } newGVK := obj.GetObjectKind().GroupVersionKind() @@ -137,9 +144,15 @@ func (r *request) mutateResponse(obj Object) (bool, error) { return false, fmt.Errorf("invalid deep copy semantics for %T: %#v", obj, r) } + var errs []error for _, respFunc := range r.respFuncs { respFunc := respFunc - respFunc(obj) + if err := respFunc(obj); err != nil { + errs = append(errs, err) + } + } + if err := errors.NewAggregate(errs); err != nil { + return false, fmt.Errorf("response mutation failed: %w", err) } mutated := !apiequality.Semantic.DeepEqual(origObj, obj) diff --git a/internal/kubeclient/middleware_test.go b/internal/kubeclient/middleware_test.go index 4c94e8df..583b3f74 100644 --- a/internal/kubeclient/middleware_test.go +++ b/internal/kubeclient/middleware_test.go @@ -15,7 +15,7 @@ import ( func Test_request_mutate(t *testing.T) { tests := []struct { name string - reqFuncs []func(Object) + reqFuncs []func(Object) error obj Object want *mutationResult wantObj Object @@ -23,10 +23,11 @@ func Test_request_mutate(t *testing.T) { }{ { name: "mutate config map data", - reqFuncs: []func(Object){ - func(obj Object) { + reqFuncs: []func(Object) error{ + func(obj Object) error { cm := obj.(*corev1.ConfigMap) cm.Data = map[string]string{"new": "stuff"} + return nil }, }, obj: &corev1.ConfigMap{ diff --git a/internal/kubeclient/verb_test.go b/internal/kubeclient/verb_test.go index 7b2bf61b..c9df4f89 100644 --- a/internal/kubeclient/verb_test.go +++ b/internal/kubeclient/verb_test.go @@ -42,7 +42,7 @@ func Test_verb(t *testing.T) { f: func() string { return fmt.Errorf("%#v", request{verb: VerbPatch}).Error() }, - want: `kubeclient.request{verb:"patch", namespace:"", resource:schema.GroupVersionResource{Group:"", Version:"", Resource:""}, reqFuncs:[]func(kubeclient.Object)(nil), respFuncs:[]func(kubeclient.Object)(nil), subresource:""}`, + want: `kubeclient.request{verb:"patch", namespace:"", resource:schema.GroupVersionResource{Group:"", Version:"", Resource:""}, reqFuncs:[]func(kubeclient.Object) error(nil), respFuncs:[]func(kubeclient.Object) error(nil), subresource:""}`, }, } for _, tt := range tests { diff --git a/internal/ownerref/ownerref.go b/internal/ownerref/ownerref.go index b036d5d2..854f7547 100644 --- a/internal/ownerref/ownerref.go +++ b/internal/ownerref/ownerref.go @@ -51,13 +51,15 @@ func New(refObj kubeclient.Object) kubeclient.Middleware { return } - rt.MutateRequest(func(obj kubeclient.Object) { + rt.MutateRequest(func(obj kubeclient.Object) error { // we only want to set the owner ref on create and when one is not already present if len(obj.GetOwnerReferences()) != 0 { - return + return nil } obj.SetOwnerReferences([]metav1.OwnerReference{ref}) + + return nil }) }) } diff --git a/internal/ownerref/ownerref_test.go b/internal/ownerref/ownerref_test.go index 0875ea7c..7f98ff94 100644 --- a/internal/ownerref/ownerref_test.go +++ b/internal/ownerref/ownerref_test.go @@ -213,7 +213,7 @@ func TestOwnerReferenceMiddleware(t *testing.T) { orig := tt.args.obj.DeepCopyObject().(kubeclient.Object) for _, mutateRequest := range rt.MutateRequests { mutateRequest := mutateRequest - mutateRequest(tt.args.obj) + require.NoError(t, mutateRequest(tt.args.obj)) } if !tt.wantMutates { require.Equal(t, orig, tt.args.obj) diff --git a/internal/plog/klog.go b/internal/plog/klog.go index 52759814..9544d886 100644 --- a/internal/plog/klog.go +++ b/internal/plog/klog.go @@ -4,6 +4,7 @@ package plog import ( + "fmt" "sync" "github.com/spf13/pflag" @@ -32,6 +33,17 @@ func RemoveKlogGlobalFlags() { } } +// KRef is (mostly) copied from klog - it is a standard way to represent a a metav1.Object in logs +// when you only have access to the namespace and name of the object. +func KRef(namespace, name string) string { + return fmt.Sprintf("%s/%s", namespace, name) +} + +// KObj is (mostly) copied from klog - it is a standard way to represent a metav1.Object in logs. +func KObj(obj klog.KMetadata) string { + return fmt.Sprintf("%s/%s", obj.GetNamespace(), obj.GetName()) +} + func klogLevelForPlogLevel(plogLevel LogLevel) (klogLevel klog.Level) { switch plogLevel { case LevelWarning: 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/internal/testutil/round_trip.go b/internal/testutil/roundtrip.go similarity index 87% rename from internal/testutil/round_trip.go rename to internal/testutil/roundtrip.go index 9b12b0e6..8c04e7c4 100644 --- a/internal/testutil/round_trip.go +++ b/internal/testutil/roundtrip.go @@ -17,7 +17,7 @@ type RoundTrip struct { resource schema.GroupVersionResource subresource string - MutateRequests, MutateResponses []func(kubeclient.Object) + MutateRequests, MutateResponses []func(kubeclient.Object) error } func (rt *RoundTrip) WithVerb(verb kubeclient.Verb) *RoundTrip { @@ -61,10 +61,10 @@ func (rt *RoundTrip) Subresource() string { return rt.subresource } -func (rt *RoundTrip) MutateRequest(fn func(kubeclient.Object)) { +func (rt *RoundTrip) MutateRequest(fn func(kubeclient.Object) error) { rt.MutateRequests = append(rt.MutateRequests, fn) } -func (rt *RoundTrip) MutateResponse(fn func(kubeclient.Object)) { +func (rt *RoundTrip) MutateResponse(fn func(kubeclient.Object) error) { rt.MutateResponses = append(rt.MutateResponses, fn) } diff --git a/pkg/conciergeclient/conciergeclient.go b/pkg/conciergeclient/conciergeclient.go index 6f4c704e..5943e24c 100644 --- a/pkg/conciergeclient/conciergeclient.go +++ b/pkg/conciergeclient/conciergeclient.go @@ -12,7 +12,7 @@ import ( "net/url" "strings" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" "k8s.io/client-go/tools/clientcmd" @@ -27,27 +27,17 @@ 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 - authenticatorName string - authenticatorKind string - 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 - } + authenticator *corev1.TypedLocalObjectReference + caBundle string + endpoint *url.URL + apiGroupSuffix string } // WithAuthenticator configures the authenticator reference (spec.authenticator) of the TokenCredentialRequests. @@ -56,15 +46,18 @@ func WithAuthenticator(authType, authName string) Option { if authName == "" { return fmt.Errorf("authenticator name must not be empty") } - c.authenticatorName = authName + authenticator := corev1.TypedLocalObjectReference{Name: authName} switch strings.ToLower(authType) { case "webhook": - c.authenticatorKind = "WebhookAuthenticator" + authenticator.APIGroup = &auth1alpha1.SchemeGroupVersion.Group + authenticator.Kind = "WebhookAuthenticator" case "jwt": - c.authenticatorKind = "JWTAuthenticator" + authenticator.APIGroup = &auth1alpha1.SchemeGroupVersion.Group + authenticator.Kind = "JWTAuthenticator" default: return fmt.Errorf(`invalid authenticator type: %q, supported values are "webhook" and "jwt"`, authType) } + c.authenticator = &authenticator return nil } } @@ -125,13 +118,13 @@ 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 } } - if c.authenticatorName == "" { + if c.authenticator == nil { return nil, fmt.Errorf("WithAuthenticator must be specified") } if c.endpoint == nil { @@ -178,18 +171,10 @@ func (c *Client) ExchangeToken(ctx context.Context, token string) (*clientauthen if err != nil { return nil, err } - replacedAPIGroupName, _ := groupsuffix.Replace(auth1alpha1.SchemeGroupVersion.Group, c.apiGroupSuffix) - 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: v1.TypedLocalObjectReference{ - APIGroup: &replacedAPIGroupName, - Kind: c.authenticatorKind, - Name: c.authenticatorName, - }, + Token: token, + Authenticator: *c.authenticator, }, }, metav1.CreateOptions{}) if err != nil { diff --git a/pkg/conciergeclient/conciergeclient_test.go b/pkg/conciergeclient/conciergeclient_test.go index bdf27364..9a0a1500 100644 --- a/pkg/conciergeclient/conciergeclient_test.go +++ b/pkg/conciergeclient/conciergeclient_test.go @@ -21,7 +21,6 @@ import ( loginv1alpha1 "go.pinniped.dev/generated/1.20/apis/concierge/login/v1alpha1" "go.pinniped.dev/internal/certauthority" - "go.pinniped.dev/internal/here" "go.pinniped.dev/internal/testutil" ) @@ -126,7 +125,6 @@ func TestNew(t *testing.T) { { name: "valid", opts: []Option{ - WithNamespace("test-namespace"), WithEndpoint("https://example.com"), WithCABundle(""), WithCABundle(string(testCA.Bundle())), @@ -221,97 +219,62 @@ func TestExchangeToken(t *testing.T) { t.Parallel() expires := metav1.NewTime(time.Now().Truncate(time.Second)) - caBundle, endpoint := runFakeServer(t, expires, "pinniped.dev") + // 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/tokencredentialrequests", r.URL.Path) + require.Equal(t, "application/json", r.Header.Get("content-type")) - client, err := New(WithNamespace("test-namespace"), WithEndpoint(endpoint), WithCABundle(caBundle), WithAuthenticator("webhook", "test-webhook")) - require.NoError(t, err) - - got, err := client.ExchangeToken(ctx, "test-token") - require.NoError(t, err) - require.Equal(t, &clientauthenticationv1beta1.ExecCredential{ - TypeMeta: metav1.TypeMeta{ - Kind: "ExecCredential", - APIVersion: "client.authentication.k8s.io/v1beta1", - }, - Status: &clientauthenticationv1beta1.ExecCredentialStatus{ - ClientCertificateData: "test-certificate", - ClientKeyData: "test-key", - ExpirationTimestamp: &expires, - }, - }, got) - }) - - t.Run("changing the API group suffix for the client sends the custom suffix on the CredentialRequest's APIGroup and on its spec.Authenticator.APIGroup", func(t *testing.T) { - t.Parallel() - expires := metav1.NewTime(time.Now().Truncate(time.Second)) - - caBundle, endpoint := runFakeServer(t, expires, "suffix.com") - - client, err := New(WithAPIGroupSuffix("suffix.com"), WithNamespace("test-namespace"), WithEndpoint(endpoint), WithCABundle(caBundle), WithAuthenticator("webhook", "test-webhook")) - require.NoError(t, err) - - got, err := client.ExchangeToken(ctx, "test-token") - require.NoError(t, err) - require.Equal(t, &clientauthenticationv1beta1.ExecCredential{ - TypeMeta: metav1.TypeMeta{ - Kind: "ExecCredential", - APIVersion: "client.authentication.k8s.io/v1beta1", - }, - Status: &clientauthenticationv1beta1.ExecCredentialStatus{ - ClientCertificateData: "test-certificate", - ClientKeyData: "test-key", - ExpirationTimestamp: &expires, - }, - }, got) - }) -} - -// Start a test server that returns successfully and asserts various properties of the request. -func runFakeServer(t *testing.T, expires metav1.Time, pinnipedAPIGroupSuffix string) (string, string) { - caBundle, endpoint := testutil.TLSTestServer(t, func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, http.MethodPost, r.Method) - require.Equal(t, - fmt.Sprintf("/apis/login.concierge.%s/v1alpha1/namespaces/test-namespace/tokencredentialrequests", pinnipedAPIGroupSuffix), - r.URL.Path) - require.Equal(t, "application/json", r.Header.Get("content-type")) - - body, err := ioutil.ReadAll(r.Body) - require.NoError(t, err) - require.JSONEq(t, here.Docf( - `{ + body, err := ioutil.ReadAll(r.Body) + require.NoError(t, err) + require.JSONEq(t, + `{ "kind": "TokenCredentialRequest", - "apiVersion": "login.concierge.%s/v1alpha1", + "apiVersion": "login.concierge.pinniped.dev/v1alpha1", "metadata": { - "creationTimestamp": null, - "namespace": "test-namespace" + "creationTimestamp": null }, "spec": { "token": "test-token", "authenticator": { - "apiGroup": "authentication.concierge.%s", + "apiGroup": "authentication.concierge.pinniped.dev", "kind": "WebhookAuthenticator", "name": "test-webhook" } }, "status": {} - }`, pinnipedAPIGroupSuffix, pinnipedAPIGroupSuffix), - string(body), - ) + }`, + string(body), + ) - w.Header().Set("content-type", "application/json") - _ = json.NewEncoder(w).Encode(&loginv1alpha1.TokenCredentialRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: fmt.Sprintf("login.concierge.%s/v1alpha1", pinnipedAPIGroupSuffix), - Kind: "TokenCredentialRequest", - }, - Status: loginv1alpha1.TokenCredentialRequestStatus{ - Credential: &loginv1alpha1.ClusterCredential{ - ExpirationTimestamp: expires, - ClientCertificateData: "test-certificate", - ClientKeyData: "test-key", + w.Header().Set("content-type", "application/json") + _ = json.NewEncoder(w).Encode(&loginv1alpha1.TokenCredentialRequest{ + TypeMeta: metav1.TypeMeta{APIVersion: "login.concierge.pinniped.dev/v1alpha1", Kind: "TokenCredentialRequest"}, + Status: loginv1alpha1.TokenCredentialRequestStatus{ + Credential: &loginv1alpha1.ClusterCredential{ + ExpirationTimestamp: expires, + ClientCertificateData: "test-certificate", + ClientKeyData: "test-key", + }, }, - }, + }) }) + + client, err := New(WithEndpoint(endpoint), WithCABundle(caBundle), WithAuthenticator("webhook", "test-webhook")) + require.NoError(t, err) + + got, err := client.ExchangeToken(ctx, "test-token") + require.NoError(t, err) + require.Equal(t, &clientauthenticationv1beta1.ExecCredential{ + TypeMeta: metav1.TypeMeta{ + Kind: "ExecCredential", + APIVersion: "client.authentication.k8s.io/v1beta1", + }, + Status: &clientauthenticationv1beta1.ExecCredentialStatus{ + ClientCertificateData: "test-certificate", + ClientKeyData: "test-key", + ExpirationTimestamp: &expires, + }, + }, got) }) - return caBundle, endpoint } 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/deploy/dex/proxy.yaml b/test/deploy/dex/proxy.yaml index c78d8ae9..c8dae2ad 100644 --- a/test/deploy/dex/proxy.yaml +++ b/test/deploy/dex/proxy.yaml @@ -48,7 +48,7 @@ spec: periodSeconds: 5 failureThreshold: 2 - name: accesslogs - image: debian:10.7-slim + image: debian:10.8-slim command: - "/bin/sh" - "-c" diff --git a/test/integration/cli_test.go b/test/integration/cli_test.go index 887c264e..910d1ac4 100644 --- a/test/integration/cli_test.go +++ b/test/integration/cli_test.go @@ -51,25 +51,12 @@ func TestCLIGetKubeconfigStaticToken(t *testing.T) { args []string expectStderr string }{ - { - name: "deprecated command", - args: []string{ - "get-kubeconfig", - "--token", env.TestUser.Token, - "--pinniped-namespace", env.ConciergeNamespace, - "--authenticator-type", "webhook", - "--authenticator-name", authenticator.Name, - "--api-group-suffix", env.APIGroupSuffix, - }, - expectStderr: "Command \"get-kubeconfig\" is deprecated, Please use `pinniped get kubeconfig` instead.\n", - }, { name: "newer command, but still using static parameters", args: []string{ "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 2aabe315..b912073d 100644 --- a/test/integration/concierge_api_serving_certs_test.go +++ b/test/integration/concierge_api_serving_certs_test.go @@ -78,11 +78,15 @@ func TestAPIServingCertificateAutoCreationAndRotation(t *testing.T) { kubeClient := library.NewKubernetesClientset(t) aggregatedClient := library.NewAggregatedClientset(t) conciergeClient := library.NewConciergeClientset(t) - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) defer cancel() apiServiceName := "v1alpha1.login.concierge." + env.APIGroupSuffix + // Create a testWebhook so we have a legitimate authenticator to pass to the + // TokenCredentialRequest API. + testWebhook := library.CreateTestWebhookAuthenticator(ctx, t) + // Get the initial auto-generated version of the Secret. secret, err := kubeClient.CoreV1().Secrets(env.ConciergeNamespace).Get(ctx, defaultServingCertResourceName, metav1.GetOptions{}) require.NoError(t, err) @@ -142,10 +146,10 @@ 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"}, + Spec: loginv1alpha1.TokenCredentialRequestSpec{Token: "not a good token", Authenticator: testWebhook}, }, metav1.CreateOptions{}) if err != nil { break 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..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, "") @@ -29,7 +31,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) @@ -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/concierge_credentialrequest_test.go b/test/integration/concierge_credentialrequest_test.go index 29878b9f..6f8236b7 100644 --- a/test/integration/concierge_credentialrequest_test.go +++ b/test/integration/concierge_credentialrequest_test.go @@ -135,7 +135,16 @@ func TestFailedCredentialRequestWhenTheRequestIsValidButTheTokenDoesNotAuthentic library.AssertNoRestartsDuringTest(t, env.ConciergeNamespace, "") - response, err := makeRequest(context.Background(), t, loginv1alpha1.TokenCredentialRequestSpec{Token: "not a good token"}) + // Create a testWebhook so we have a legitimate authenticator to pass to the + // TokenCredentialRequest API. + ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) + defer cancel() + testWebhook := library.CreateTestWebhookAuthenticator(ctx, t) + + response, err := makeRequest(context.Background(), t, loginv1alpha1.TokenCredentialRequestSpec{ + Token: "not a good token", + Authenticator: testWebhook, + }) require.NoError(t, err) @@ -149,7 +158,16 @@ func TestCredentialRequest_ShouldFailWhenRequestDoesNotIncludeToken(t *testing.T library.AssertNoRestartsDuringTest(t, env.ConciergeNamespace, "") - response, err := makeRequest(context.Background(), t, loginv1alpha1.TokenCredentialRequestSpec{Token: ""}) + // Create a testWebhook so we have a legitimate authenticator to pass to the + // TokenCredentialRequest API. + ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) + defer cancel() + testWebhook := library.CreateTestWebhookAuthenticator(ctx, t) + + response, err := makeRequest(context.Background(), t, loginv1alpha1.TokenCredentialRequestSpec{ + Token: "", + Authenticator: testWebhook, + }) require.Error(t, err) statusError, isStatus := err.(*errors.StatusError) @@ -193,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/concierge_kubecertagent_test.go b/test/integration/concierge_kubecertagent_test.go index 73d9d4f6..37392013 100644 --- a/test/integration/concierge_kubecertagent_test.go +++ b/test/integration/concierge_kubecertagent_test.go @@ -16,6 +16,7 @@ import ( "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/wait" "go.pinniped.dev/test/library" ) @@ -90,6 +91,9 @@ func TestKubeCertAgent(t *testing.T) { } t.Run("reconcile on update", func(t *testing.T) { + // Ensure that the next test will start from a known state. + defer ensureKubeCertAgentSteadyState(t, agentPodsReconciled) + // Update the image of the first pod. The controller should see it, and flip it back. // // Note that we update the toleration field here because it is the only field, currently, that @@ -109,6 +113,9 @@ func TestKubeCertAgent(t *testing.T) { }) t.Run("reconcile on delete", func(t *testing.T) { + // Ensure that the next test will start from a known state. + defer ensureKubeCertAgentSteadyState(t, agentPodsReconciled) + // Delete the first pod. The controller should see it, and flip it back. err = kubeClient. CoreV1(). @@ -122,6 +129,21 @@ func TestKubeCertAgent(t *testing.T) { }) } +func ensureKubeCertAgentSteadyState(t *testing.T, agentPodsReconciled func() bool) { + t.Helper() + + const wantSteadyStateSnapshots = 3 + var steadyStateSnapshots int + require.NoError(t, wait.Poll(250*time.Millisecond, 30*time.Second, func() (bool, error) { + if agentPodsReconciled() { + steadyStateSnapshots++ + } else { + steadyStateSnapshots = 0 + } + return steadyStateSnapshots == wantSteadyStateSnapshots, nil + })) +} + func sortPods(pods *corev1.PodList) { sort.Slice(pods.Items, func(i, j int) bool { return pods.Items[i].Name < pods.Items[j].Name 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/kube_api_discovery_test.go b/test/integration/kube_api_discovery_test.go index dba382bc..c7783b81 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"}, }, }, @@ -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"}, + }, }, }, }, @@ -158,11 +164,17 @@ 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"}, }, + { + Name: "credentialissuers/status", + Namespaced: false, + Kind: "CredentialIssuer", + Verbs: []string{"get", "patch", "update"}, + }, }, }, }, @@ -185,19 +197,31 @@ 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"}, }, + { + Name: "webhookauthenticators/status", + Namespaced: false, + Kind: "WebhookAuthenticator", + Verbs: []string{"get", "patch", "update"}, + }, { 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"}, }, + { + Name: "jwtauthenticators/status", + Namespaced: false, + Kind: "JWTAuthenticator", + Verbs: []string{"get", "patch", "update"}, + }, }, }, }, @@ -236,6 +260,49 @@ 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("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 { diff --git a/test/integration/kubeclient_test.go b/test/integration/kubeclient_test.go index 211287f1..dbe5c9c4 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,29 +200,34 @@ 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(namespace.Name).Create( + credentialIssuer, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers().Create( ctx, &conciergeconfigv1alpha1.CredentialIssuer{ ObjectMeta: metav1.ObjectMeta{ GenerateName: "owner-ref-test-", OwnerReferences: nil, // no owner refs set }, - Status: conciergeconfigv1alpha1.CredentialIssuerStatus{ - Strategies: []conciergeconfigv1alpha1.CredentialIssuerStrategy{}, - }, }, 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(namespace.Name).Get(ctx, credentialIssuer.Name, metav1.GetOptions{}) + _, err := ownerRefClient.PinnipedConcierge.ConfigV1alpha1().CredentialIssuers().Get(ctx, credentialIssuer.Name, metav1.GetOptions{}) return err }) @@ -246,13 +289,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() diff --git a/test/library/client.go b/test/library/client.go index 392c153e..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() @@ -180,11 +180,8 @@ func CreateTestWebhookAuthenticator(ctx context.Context, t *testing.T) corev1.Ty require.NoErrorf(t, err, "could not cleanup test WebhookAuthenticator %s/%s", webhook.Namespace, webhook.Name) }) - apiGroup, replacedSuffix := groupsuffix.Replace(auth1alpha1.SchemeGroupVersion.Group, testEnv.APIGroupSuffix) - require.True(t, replacedSuffix) - return corev1.TypedLocalObjectReference{ - APIGroup: &apiGroup, + APIGroup: &auth1alpha1.SchemeGroupVersion.Group, Kind: "WebhookAuthenticator", Name: webhook.Name, } @@ -223,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() @@ -253,11 +249,8 @@ func CreateTestJWTAuthenticator(ctx context.Context, t *testing.T, spec auth1alp require.NoErrorf(t, err, "could not cleanup test JWTAuthenticator %s/%s", jwtAuthenticator.Namespace, jwtAuthenticator.Name) }) - apiGroup, replacedSuffix := groupsuffix.Replace(auth1alpha1.SchemeGroupVersion.Group, testEnv.APIGroupSuffix) - require.True(t, replacedSuffix) - return corev1.TypedLocalObjectReference{ - APIGroup: &apiGroup, + APIGroup: &auth1alpha1.SchemeGroupVersion.Group, Kind: "JWTAuthenticator", Name: jwtAuthenticator.Name, }