From e69183aa8a1ff8f6df1b730b771f656c1f698919 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Fri, 30 Oct 2020 11:03:25 -0500 Subject: [PATCH] Rename `idp.concierge.pinniped.dev` to `authentication.concierge.pinniped.dev`. Signed-off-by: Matt Moyer --- apis/concierge/authentication/doc.go.tmpl | 8 + .../v1alpha1/conversion.go.tmpl | 0 .../v1alpha1/defaults.go.tmpl | 0 .../v1alpha1/doc.go.tmpl | 5 +- .../v1alpha1/register.go.tmpl | 2 +- .../v1alpha1/types_meta.go.tmpl | 0 .../v1alpha1/types_tls.go.tmpl | 0 .../v1alpha1/types_webhook.go.tmpl | 0 apis/concierge/idp/doc.go.tmpl | 8 - cmd/pinniped/cmd/exchange_credential.go | 4 +- cmd/pinniped/cmd/get_kubeconfig.go | 2 +- cmd/pinniped/cmd/get_kubeconfig_test.go | 8 +- ...pinniped.dev_webhookidentityproviders.yaml | 4 +- ...pinniped.dev_webhookidentityproviders.yaml | 4 +- deploy/concierge/rbac.yaml | 2 +- deploy/concierge/z0_crd_overlay.yaml | 2 +- doc/demo.md | 2 +- generated/1.17/README.adoc | 210 +++++++++--------- .../1.17/apis/concierge/authentication/doc.go | 8 + .../v1alpha1/conversion.go | 0 .../v1alpha1/defaults.go | 0 .../{idp => authentication}/v1alpha1/doc.go | 5 +- .../v1alpha1/register.go | 2 +- .../v1alpha1/types_meta.go | 0 .../v1alpha1/types_tls.go | 0 .../v1alpha1/types_webhook.go | 0 .../v1alpha1/zz_generated.conversion.go | 0 .../v1alpha1/zz_generated.deepcopy.go | 0 .../v1alpha1/zz_generated.defaults.go | 0 .../authentication}/zz_generated.deepcopy.go | 2 +- generated/1.17/apis/concierge/idp/doc.go | 8 - .../client/clientset/versioned/clientset.go | 28 +-- .../versioned/fake/clientset_generated.go | 14 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../v1alpha1/authentication_client.go} | 28 +-- .../{idp => authentication}/v1alpha1/doc.go | 0 .../v1alpha1/fake/doc.go | 0 .../fake/fake_authentication_client.go} | 8 +- .../fake/fake_webhookidentityprovider.go | 8 +- .../v1alpha1/generated_expansion.go | 0 .../v1alpha1/webhookidentityprovider.go | 4 +- .../{idp => authentication}/interface.go | 4 +- .../v1alpha1/interface.go | 0 .../v1alpha1/webhookidentityprovider.go | 12 +- .../informers/externalversions/factory.go | 12 +- .../informers/externalversions/generic.go | 20 +- .../v1alpha1/expansion_generated.go | 0 .../v1alpha1/webhookidentityprovider.go | 2 +- .../client/openapi/zz_generated.openapi.go | 172 +++++++------- ...inniped.dev_webhookidentityproviders.yaml} | 4 +- generated/1.18/README.adoc | 210 +++++++++--------- .../1.18/apis/concierge/authentication/doc.go | 8 + .../v1alpha1/conversion.go | 0 .../v1alpha1/defaults.go | 0 .../{idp => authentication}/v1alpha1/doc.go | 5 +- .../authentication}/v1alpha1/register.go | 2 +- .../v1alpha1/types_meta.go | 0 .../v1alpha1/types_tls.go | 0 .../v1alpha1/types_webhook.go | 0 .../v1alpha1/zz_generated.conversion.go | 0 .../v1alpha1/zz_generated.deepcopy.go | 0 .../v1alpha1/zz_generated.defaults.go | 0 .../authentication}/zz_generated.deepcopy.go | 2 +- generated/1.18/apis/concierge/idp/doc.go | 8 - .../client/clientset/versioned/clientset.go | 28 +-- .../versioned/fake/clientset_generated.go | 14 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../v1alpha1/authentication_client.go} | 28 +-- .../{idp => authentication}/v1alpha1/doc.go | 0 .../v1alpha1/fake/doc.go | 0 .../fake/fake_authentication_client.go} | 8 +- .../fake/fake_webhookidentityprovider.go | 8 +- .../v1alpha1/generated_expansion.go | 0 .../v1alpha1/webhookidentityprovider.go | 4 +- .../{idp => authentication}/interface.go | 4 +- .../v1alpha1/interface.go | 0 .../v1alpha1/webhookidentityprovider.go | 12 +- .../informers/externalversions/factory.go | 12 +- .../informers/externalversions/generic.go | 20 +- .../v1alpha1/expansion_generated.go | 0 .../v1alpha1/webhookidentityprovider.go | 2 +- .../client/openapi/zz_generated.openapi.go | 172 +++++++------- ...inniped.dev_webhookidentityproviders.yaml} | 4 +- generated/1.19/README.adoc | 210 +++++++++--------- .../1.19/apis/concierge/authentication/doc.go | 8 + .../v1alpha1/conversion.go | 0 .../v1alpha1/defaults.go | 0 .../{idp => authentication}/v1alpha1/doc.go | 5 +- .../authentication}/v1alpha1/register.go | 2 +- .../v1alpha1/types_meta.go | 0 .../v1alpha1/types_tls.go | 0 .../v1alpha1/types_webhook.go | 0 .../v1alpha1/zz_generated.conversion.go | 0 .../v1alpha1/zz_generated.deepcopy.go | 0 .../v1alpha1/zz_generated.defaults.go | 0 .../zz_generated.deepcopy.go | 2 +- generated/1.19/apis/concierge/idp/doc.go | 8 - .../client/clientset/versioned/clientset.go | 28 +-- .../versioned/fake/clientset_generated.go | 14 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../v1alpha1/authentication_client.go} | 28 +-- .../{idp => authentication}/v1alpha1/doc.go | 0 .../v1alpha1/fake/doc.go | 0 .../fake/fake_authentication_client.go} | 8 +- .../fake/fake_webhookidentityprovider.go | 8 +- .../v1alpha1/generated_expansion.go | 0 .../v1alpha1/webhookidentityprovider.go | 4 +- .../{idp => authentication}/interface.go | 4 +- .../v1alpha1/interface.go | 0 .../v1alpha1/webhookidentityprovider.go | 12 +- .../informers/externalversions/factory.go | 12 +- .../informers/externalversions/generic.go | 20 +- .../v1alpha1/expansion_generated.go | 0 .../v1alpha1/webhookidentityprovider.go | 2 +- .../client/openapi/zz_generated.openapi.go | 174 +++++++-------- ...pinniped.dev_webhookidentityproviders.yaml | 149 +++++++++++++ hack/lib/docs/config.yaml | 2 +- hack/lib/tilt/Tiltfile | 2 +- hack/lib/update-codegen.sh | 8 +- internal/client/client_test.go | 6 +- .../identityprovider/idpcache/cache_test.go | 4 +- .../webhookcachecleaner.go | 8 +- .../webhookcachecleaner_test.go | 18 +- .../webhookcachefiller/webhookcachefiller.go | 10 +- .../webhookcachefiller_test.go | 26 +-- .../controllermanager/prepare_controllers.go | 4 +- .../concierge_credentialrequest_test.go | 4 +- test/integration/kube_api_discovery_test.go | 8 +- test/library/client.go | 8 +- test/library/env.go | 6 +- 133 files changed, 1067 insertions(+), 922 deletions(-) create mode 100644 apis/concierge/authentication/doc.go.tmpl rename apis/concierge/{idp => authentication}/v1alpha1/conversion.go.tmpl (100%) rename apis/concierge/{idp => authentication}/v1alpha1/defaults.go.tmpl (100%) rename apis/concierge/{idp => authentication}/v1alpha1/doc.go.tmpl (83%) rename apis/concierge/{idp => authentication}/v1alpha1/register.go.tmpl (95%) rename apis/concierge/{idp => authentication}/v1alpha1/types_meta.go.tmpl (100%) rename apis/concierge/{idp => authentication}/v1alpha1/types_tls.go.tmpl (100%) rename apis/concierge/{idp => authentication}/v1alpha1/types_webhook.go.tmpl (100%) delete mode 100644 apis/concierge/idp/doc.go.tmpl rename generated/1.17/crds/idp.concierge.pinniped.dev_webhookidentityproviders.yaml => deploy/concierge/authentication.concierge.pinniped.dev_webhookidentityproviders.yaml (98%) create mode 100644 generated/1.17/apis/concierge/authentication/doc.go rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/conversion.go (100%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/defaults.go (100%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/doc.go (83%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/register.go (95%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/types_meta.go (100%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/types_tls.go (100%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/types_webhook.go (100%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.conversion.go (100%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.deepcopy.go (100%) rename generated/1.17/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.defaults.go (100%) rename generated/{1.18/apis/concierge/idp => 1.17/apis/concierge/authentication}/zz_generated.deepcopy.go (89%) delete mode 100644 generated/1.17/apis/concierge/idp/doc.go rename generated/1.17/client/clientset/versioned/typed/{idp/v1alpha1/idp_client.go => authentication/v1alpha1/authentication_client.go} (53%) rename generated/1.17/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/doc.go (100%) rename generated/1.17/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/fake/doc.go (100%) rename generated/1.17/client/clientset/versioned/typed/{idp/v1alpha1/fake/fake_idp_client.go => authentication/v1alpha1/fake/fake_authentication_client.go} (66%) rename generated/1.17/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/fake/fake_webhookidentityprovider.go (94%) rename generated/1.17/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/generated_expansion.go (100%) rename generated/1.17/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/webhookidentityprovider.go (97%) rename generated/1.17/client/informers/externalversions/{idp => authentication}/interface.go (94%) rename generated/1.17/client/informers/externalversions/{idp => authentication}/v1alpha1/interface.go (100%) rename generated/1.17/client/informers/externalversions/{idp => authentication}/v1alpha1/webhookidentityprovider.go (85%) rename generated/1.17/client/listers/{idp => authentication}/v1alpha1/expansion_generated.go (100%) rename generated/1.17/client/listers/{idp => authentication}/v1alpha1/webhookidentityprovider.go (97%) rename generated/{1.18/crds/idp.concierge.pinniped.dev_webhookidentityproviders.yaml => 1.17/crds/authentication.concierge.pinniped.dev_webhookidentityproviders.yaml} (98%) create mode 100644 generated/1.18/apis/concierge/authentication/doc.go rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/conversion.go (100%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/defaults.go (100%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/doc.go (83%) rename generated/{1.19/apis/concierge/idp => 1.18/apis/concierge/authentication}/v1alpha1/register.go (95%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/types_meta.go (100%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/types_tls.go (100%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/types_webhook.go (100%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.conversion.go (100%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.deepcopy.go (100%) rename generated/1.18/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.defaults.go (100%) rename generated/{1.17/apis/concierge/idp => 1.18/apis/concierge/authentication}/zz_generated.deepcopy.go (89%) delete mode 100644 generated/1.18/apis/concierge/idp/doc.go rename generated/1.18/client/clientset/versioned/typed/{idp/v1alpha1/idp_client.go => authentication/v1alpha1/authentication_client.go} (53%) rename generated/1.18/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/doc.go (100%) rename generated/1.18/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/fake/doc.go (100%) rename generated/1.18/client/clientset/versioned/typed/{idp/v1alpha1/fake/fake_idp_client.go => authentication/v1alpha1/fake/fake_authentication_client.go} (66%) rename generated/{1.19/client/clientset/versioned/typed/idp => 1.18/client/clientset/versioned/typed/authentication}/v1alpha1/fake/fake_webhookidentityprovider.go (94%) rename generated/1.18/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/generated_expansion.go (100%) rename generated/1.18/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/webhookidentityprovider.go (97%) rename generated/1.18/client/informers/externalversions/{idp => authentication}/interface.go (94%) rename generated/1.18/client/informers/externalversions/{idp => authentication}/v1alpha1/interface.go (100%) rename generated/1.18/client/informers/externalversions/{idp => authentication}/v1alpha1/webhookidentityprovider.go (84%) rename generated/1.18/client/listers/{idp => authentication}/v1alpha1/expansion_generated.go (100%) rename generated/1.18/client/listers/{idp => authentication}/v1alpha1/webhookidentityprovider.go (97%) rename generated/{1.19/crds/idp.concierge.pinniped.dev_webhookidentityproviders.yaml => 1.18/crds/authentication.concierge.pinniped.dev_webhookidentityproviders.yaml} (98%) create mode 100644 generated/1.19/apis/concierge/authentication/doc.go rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/conversion.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/defaults.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/doc.go (83%) rename generated/{1.18/apis/concierge/idp => 1.19/apis/concierge/authentication}/v1alpha1/register.go (95%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/types_meta.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/types_tls.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/types_webhook.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.conversion.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.deepcopy.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/v1alpha1/zz_generated.defaults.go (100%) rename generated/1.19/apis/concierge/{idp => authentication}/zz_generated.deepcopy.go (89%) delete mode 100644 generated/1.19/apis/concierge/idp/doc.go rename generated/1.19/client/clientset/versioned/typed/{idp/v1alpha1/idp_client.go => authentication/v1alpha1/authentication_client.go} (53%) rename generated/1.19/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/doc.go (100%) rename generated/1.19/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/fake/doc.go (100%) rename generated/1.19/client/clientset/versioned/typed/{idp/v1alpha1/fake/fake_idp_client.go => authentication/v1alpha1/fake/fake_authentication_client.go} (66%) rename generated/{1.18/client/clientset/versioned/typed/idp => 1.19/client/clientset/versioned/typed/authentication}/v1alpha1/fake/fake_webhookidentityprovider.go (94%) rename generated/1.19/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/generated_expansion.go (100%) rename generated/1.19/client/clientset/versioned/typed/{idp => authentication}/v1alpha1/webhookidentityprovider.go (97%) rename generated/1.19/client/informers/externalversions/{idp => authentication}/interface.go (94%) rename generated/1.19/client/informers/externalversions/{idp => authentication}/v1alpha1/interface.go (100%) rename generated/1.19/client/informers/externalversions/{idp => authentication}/v1alpha1/webhookidentityprovider.go (84%) rename generated/1.19/client/listers/{idp => authentication}/v1alpha1/expansion_generated.go (100%) rename generated/1.19/client/listers/{idp => authentication}/v1alpha1/webhookidentityprovider.go (97%) create mode 100644 generated/1.19/crds/authentication.concierge.pinniped.dev_webhookidentityproviders.yaml diff --git a/apis/concierge/authentication/doc.go.tmpl b/apis/concierge/authentication/doc.go.tmpl new file mode 100644 index 00000000..c8558463 --- /dev/null +++ b/apis/concierge/authentication/doc.go.tmpl @@ -0,0 +1,8 @@ +// Copyright 2020 the Pinniped contributors. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// +k8s:deepcopy-gen=package +// +groupName=authentication.concierge.pinniped.dev + +// Package authentication is the internal version of the Pinniped identity provider API. +package authentication diff --git a/apis/concierge/idp/v1alpha1/conversion.go.tmpl b/apis/concierge/authentication/v1alpha1/conversion.go.tmpl similarity index 100% rename from apis/concierge/idp/v1alpha1/conversion.go.tmpl rename to apis/concierge/authentication/v1alpha1/conversion.go.tmpl diff --git a/apis/concierge/idp/v1alpha1/defaults.go.tmpl b/apis/concierge/authentication/v1alpha1/defaults.go.tmpl similarity index 100% rename from apis/concierge/idp/v1alpha1/defaults.go.tmpl rename to apis/concierge/authentication/v1alpha1/defaults.go.tmpl diff --git a/apis/concierge/idp/v1alpha1/doc.go.tmpl b/apis/concierge/authentication/v1alpha1/doc.go.tmpl similarity index 83% rename from apis/concierge/idp/v1alpha1/doc.go.tmpl rename to apis/concierge/authentication/v1alpha1/doc.go.tmpl index 86223a81..4bd09774 100644 --- a/apis/concierge/idp/v1alpha1/doc.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/doc.go.tmpl @@ -3,10 +3,9 @@ // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package -// +k8s:conversion-gen=go.pinniped.dev/GENERATED_PKG/apis/concierge/idp +// +k8s:conversion-gen=go.pinniped.dev/GENERATED_PKG/apis/concierge/authentication // +k8s:defaulter-gen=TypeMeta -// +groupName=idp.concierge.pinniped.dev -// +groupGoName=IDP +// +groupName=authentication.concierge.pinniped.dev // Package v1alpha1 is the v1alpha1 version of the Pinniped identity provider API. package v1alpha1 diff --git a/apis/concierge/idp/v1alpha1/register.go.tmpl b/apis/concierge/authentication/v1alpha1/register.go.tmpl similarity index 95% rename from apis/concierge/idp/v1alpha1/register.go.tmpl rename to apis/concierge/authentication/v1alpha1/register.go.tmpl index 02164035..b372270d 100644 --- a/apis/concierge/idp/v1alpha1/register.go.tmpl +++ b/apis/concierge/authentication/v1alpha1/register.go.tmpl @@ -9,7 +9,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" ) -const GroupName = "idp.concierge.pinniped.dev" +const GroupName = "authentication.concierge.pinniped.dev" // SchemeGroupVersion is group version used to register these objects. var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} diff --git a/apis/concierge/idp/v1alpha1/types_meta.go.tmpl b/apis/concierge/authentication/v1alpha1/types_meta.go.tmpl similarity index 100% rename from apis/concierge/idp/v1alpha1/types_meta.go.tmpl rename to apis/concierge/authentication/v1alpha1/types_meta.go.tmpl diff --git a/apis/concierge/idp/v1alpha1/types_tls.go.tmpl b/apis/concierge/authentication/v1alpha1/types_tls.go.tmpl similarity index 100% rename from apis/concierge/idp/v1alpha1/types_tls.go.tmpl rename to apis/concierge/authentication/v1alpha1/types_tls.go.tmpl diff --git a/apis/concierge/idp/v1alpha1/types_webhook.go.tmpl b/apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl similarity index 100% rename from apis/concierge/idp/v1alpha1/types_webhook.go.tmpl rename to apis/concierge/authentication/v1alpha1/types_webhook.go.tmpl diff --git a/apis/concierge/idp/doc.go.tmpl b/apis/concierge/idp/doc.go.tmpl deleted file mode 100644 index 22adc1b5..00000000 --- a/apis/concierge/idp/doc.go.tmpl +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2020 the Pinniped contributors. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -// +k8s:deepcopy-gen=package -// +groupName=idp.concierge.pinniped.dev - -// Package idp is the internal version of the Pinniped identity provider API. -package idp diff --git a/cmd/pinniped/cmd/exchange_credential.go b/cmd/pinniped/cmd/exchange_credential.go index 91941100..0e8d99d7 100644 --- a/cmd/pinniped/cmd/exchange_credential.go +++ b/cmd/pinniped/cmd/exchange_credential.go @@ -16,7 +16,7 @@ import ( corev1 "k8s.io/api/core/v1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" "go.pinniped.dev/internal/client" "go.pinniped.dev/internal/constable" "go.pinniped.dev/internal/here" @@ -143,7 +143,7 @@ func exchangeCredential(envGetter envGetter, tokenExchanger tokenExchanger, outp idp := corev1.TypedLocalObjectReference{Name: idpName} switch strings.ToLower(idpType) { case "webhook": - idp.APIGroup = &idpv1alpha1.SchemeGroupVersion.Group + idp.APIGroup = &auth1alpha1.SchemeGroupVersion.Group idp.Kind = "WebhookIdentityProvider" default: return fmt.Errorf(`%w: %q, supported values are "webhook"`, ErrInvalidIDPType, idpType) diff --git a/cmd/pinniped/cmd/get_kubeconfig.go b/cmd/pinniped/cmd/get_kubeconfig.go index 8ed99b0d..fa6935af 100644 --- a/cmd/pinniped/cmd/get_kubeconfig.go +++ b/cmd/pinniped/cmd/get_kubeconfig.go @@ -187,7 +187,7 @@ func getDefaultIDP(clientset pinnipedclientset.Interface, namespace string) (str ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*20) defer cancelFunc() - webhooks, err := clientset.IDPV1alpha1().WebhookIdentityProviders(namespace).List(ctx, metav1.ListOptions{}) + webhooks, err := clientset.AuthenticationV1alpha1().WebhookIdentityProviders(namespace).List(ctx, metav1.ListOptions{}) if err != nil { return "", "", err } diff --git a/cmd/pinniped/cmd/get_kubeconfig_test.go b/cmd/pinniped/cmd/get_kubeconfig_test.go index 23142591..23d920c5 100644 --- a/cmd/pinniped/cmd/get_kubeconfig_test.go +++ b/cmd/pinniped/cmd/get_kubeconfig_test.go @@ -17,7 +17,7 @@ import ( "k8s.io/client-go/rest" coretesting "k8s.io/client-go/testing" - idpv1alpha "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + authv1alpha "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" configv1alpha1 "go.pinniped.dev/generated/1.19/apis/config/v1alpha1" pinnipedclientset "go.pinniped.dev/generated/1.19/client/clientset/versioned" pinnipedfake "go.pinniped.dev/generated/1.19/client/clientset/versioned/fake" @@ -256,8 +256,8 @@ func TestRun(t *testing.T) { cmd.flags.idpType = "" cmd.kubeClientCreator = func(_ *rest.Config) (pinnipedclientset.Interface, error) { return pinnipedfake.NewSimpleClientset( - &idpv1alpha.WebhookIdentityProvider{ObjectMeta: metav1.ObjectMeta{Namespace: "test-namespace", Name: "webhook-one"}}, - &idpv1alpha.WebhookIdentityProvider{ObjectMeta: metav1.ObjectMeta{Namespace: "test-namespace", Name: "webhook-two"}}, + &authv1alpha.WebhookIdentityProvider{ObjectMeta: metav1.ObjectMeta{Namespace: "test-namespace", Name: "webhook-one"}}, + &authv1alpha.WebhookIdentityProvider{ObjectMeta: metav1.ObjectMeta{Namespace: "test-namespace", Name: "webhook-two"}}, ), nil } }, @@ -349,7 +349,7 @@ func TestRun(t *testing.T) { cmd.kubeClientCreator = func(_ *rest.Config) (pinnipedclientset.Interface, error) { return pinnipedfake.NewSimpleClientset( - &idpv1alpha.WebhookIdentityProvider{ObjectMeta: metav1.ObjectMeta{Namespace: "test-namespace", Name: "discovered-idp"}}, + &authv1alpha.WebhookIdentityProvider{ObjectMeta: metav1.ObjectMeta{Namespace: "test-namespace", Name: "discovered-idp"}}, newCredentialIssuerConfig("pinniped-config", "test-namespace", "https://example.com", "test-ca"), ), nil } diff --git a/generated/1.17/crds/idp.concierge.pinniped.dev_webhookidentityproviders.yaml b/deploy/concierge/authentication.concierge.pinniped.dev_webhookidentityproviders.yaml similarity index 98% rename from generated/1.17/crds/idp.concierge.pinniped.dev_webhookidentityproviders.yaml rename to deploy/concierge/authentication.concierge.pinniped.dev_webhookidentityproviders.yaml index af241642..5e7aba72 100644 --- a/generated/1.17/crds/idp.concierge.pinniped.dev_webhookidentityproviders.yaml +++ b/deploy/concierge/authentication.concierge.pinniped.dev_webhookidentityproviders.yaml @@ -6,9 +6,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.4.0 creationTimestamp: null - name: webhookidentityproviders.idp.concierge.pinniped.dev + name: webhookidentityproviders.authentication.concierge.pinniped.dev spec: - group: idp.concierge.pinniped.dev + group: authentication.concierge.pinniped.dev names: categories: - all diff --git a/deploy/concierge/idp.concierge.pinniped.dev_webhookidentityproviders.yaml b/deploy/concierge/idp.concierge.pinniped.dev_webhookidentityproviders.yaml index af241642..5e7aba72 100644 --- a/deploy/concierge/idp.concierge.pinniped.dev_webhookidentityproviders.yaml +++ b/deploy/concierge/idp.concierge.pinniped.dev_webhookidentityproviders.yaml @@ -6,9 +6,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.4.0 creationTimestamp: null - name: webhookidentityproviders.idp.concierge.pinniped.dev + name: webhookidentityproviders.authentication.concierge.pinniped.dev spec: - group: idp.concierge.pinniped.dev + group: authentication.concierge.pinniped.dev names: categories: - all diff --git a/deploy/concierge/rbac.yaml b/deploy/concierge/rbac.yaml index 1571d56d..714944be 100644 --- a/deploy/concierge/rbac.yaml +++ b/deploy/concierge/rbac.yaml @@ -59,7 +59,7 @@ rules: - apiGroups: [ "" ] resources: [ pods/exec ] verbs: [ create ] - - apiGroups: [ config.pinniped.dev, idp.concierge.pinniped.dev ] + - apiGroups: [ config.pinniped.dev, authentication.concierge.pinniped.dev ] resources: [ "*" ] verbs: [ create, get, list, update, watch ] --- diff --git a/deploy/concierge/z0_crd_overlay.yaml b/deploy/concierge/z0_crd_overlay.yaml index 7f637f7e..61f4c93e 100644 --- a/deploy/concierge/z0_crd_overlay.yaml +++ b/deploy/concierge/z0_crd_overlay.yaml @@ -10,7 +10,7 @@ metadata: #@overlay/match missing_ok=True labels: #@ labels() -#@overlay/match by=overlay.subset({"kind": "CustomResourceDefinition", "metadata":{"name":"webhookidentityproviders.idp.concierge.pinniped.dev"}}), expects=1 +#@overlay/match by=overlay.subset({"kind": "CustomResourceDefinition", "metadata":{"name":"webhookidentityproviders.authentication.concierge.pinniped.dev"}}), expects=1 --- metadata: #@overlay/match missing_ok=True diff --git a/doc/demo.md b/doc/demo.md index 8cc1a368..8b6cef40 100644 --- a/doc/demo.md +++ b/doc/demo.md @@ -122,7 +122,7 @@ as the identity provider. ```bash cat <&1 | sed "s|^|gen-api > |" ) @@ -122,7 +122,7 @@ echo "generating API-related code for our internal API groups..." "${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client" \ "${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \ "${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \ - "config:v1alpha1 concierge/idp:v1alpha1 concierge/login:v1alpha1" \ + "config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \ --go-header-file "${ROOT}/hack/boilerplate.go.txt" 2>&1 | sed "s|^|gen-int-api > |" ) @@ -137,7 +137,7 @@ echo "generating client code for our public API groups..." client,lister,informer \ "${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client" \ "${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \ - "config:v1alpha1 concierge/idp:v1alpha1 concierge/login:v1alpha1" \ + "config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \ --go-header-file "${ROOT}/hack/boilerplate.go.txt" 2>&1 | sed "s|^|gen-client > |" ) @@ -157,5 +157,5 @@ crd-ref-docs \ # Generate CRD YAML (cd apis && controller-gen paths=./config/v1alpha1 crd:trivialVersions=true output:crd:artifacts:config=../crds && - controller-gen paths=./concierge/idp/v1alpha1 crd:trivialVersions=true output:crd:artifacts:config=../crds + controller-gen paths=./concierge/authentication/v1alpha1 crd:trivialVersions=true output:crd:artifacts:config=../crds ) diff --git a/internal/client/client_test.go b/internal/client/client_test.go index bcb1e2e6..58ae7a1a 100644 --- a/internal/client/client_test.go +++ b/internal/client/client_test.go @@ -16,7 +16,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" loginv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/login/v1alpha1" "go.pinniped.dev/internal/testutil" ) @@ -26,7 +26,7 @@ func TestExchangeToken(t *testing.T) { ctx := context.Background() testIDP := corev1.TypedLocalObjectReference{ - APIGroup: &idpv1alpha1.SchemeGroupVersion.Group, + APIGroup: &auth1alpha1.SchemeGroupVersion.Group, Kind: "WebhookIdentityProvider", Name: "test-webhook", } @@ -106,7 +106,7 @@ func TestExchangeToken(t *testing.T) { "spec": { "token": "test-token", "identityProvider": { - "apiGroup": "idp.concierge.pinniped.dev", + "apiGroup": "authentication.concierge.pinniped.dev", "kind": "WebhookIdentityProvider", "name": "test-webhook" } diff --git a/internal/controller/identityprovider/idpcache/cache_test.go b/internal/controller/identityprovider/idpcache/cache_test.go index 1cc0c292..24043bc8 100644 --- a/internal/controller/identityprovider/idpcache/cache_test.go +++ b/internal/controller/identityprovider/idpcache/cache_test.go @@ -17,7 +17,7 @@ import ( "k8s.io/apiserver/pkg/authentication/authenticator" "k8s.io/apiserver/pkg/authentication/user" - idpv1alpha "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + authv1alpha "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" loginapi "go.pinniped.dev/generated/1.19/apis/concierge/login" "go.pinniped.dev/internal/mocks/mocktokenauthenticator" ) @@ -76,7 +76,7 @@ func TestAuthenticateTokenCredentialRequest(t *testing.T) { }, Spec: loginapi.TokenCredentialRequestSpec{ IdentityProvider: corev1.TypedLocalObjectReference{ - APIGroup: &idpv1alpha.SchemeGroupVersion.Group, + APIGroup: &authv1alpha.SchemeGroupVersion.Group, Kind: "WebhookIdentityProvider", Name: "test-name", }, diff --git a/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner.go b/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner.go index 9ab9e169..48b66351 100644 --- a/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner.go +++ b/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner.go @@ -11,8 +11,8 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/klog/v2" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" - idpinformers "go.pinniped.dev/generated/1.19/client/informers/externalversions/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" + idpinformers "go.pinniped.dev/generated/1.19/client/informers/externalversions/authentication/v1alpha1" pinnipedcontroller "go.pinniped.dev/internal/controller" "go.pinniped.dev/internal/controller/identityprovider/idpcache" "go.pinniped.dev/internal/controllerlib" @@ -51,7 +51,7 @@ func (c *controller) Sync(_ controllerlib.Context) error { } // Index the current webhooks by key. - webhooksByKey := map[controllerlib.Key]*idpv1alpha1.WebhookIdentityProvider{} + webhooksByKey := map[controllerlib.Key]*auth1alpha1.WebhookIdentityProvider{} for _, webhook := range webhooks { key := controllerlib.Key{Namespace: webhook.Namespace, Name: webhook.Name} webhooksByKey[key] = webhook @@ -59,7 +59,7 @@ func (c *controller) Sync(_ controllerlib.Context) error { // Delete any entries from the cache which are no longer in the cluster. for _, key := range c.cache.Keys() { - if key.APIGroup != idpv1alpha1.SchemeGroupVersion.Group || key.Kind != "WebhookIdentityProvider" { + if key.APIGroup != auth1alpha1.SchemeGroupVersion.Group || key.Kind != "WebhookIdentityProvider" { continue } if _, exists := webhooksByKey[controllerlib.Key{Namespace: key.Namespace, Name: key.Name}]; !exists { diff --git a/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner_test.go b/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner_test.go index e2450916..28f8effa 100644 --- a/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner_test.go +++ b/internal/controller/identityprovider/webhookcachecleaner/webhookcachecleaner_test.go @@ -12,7 +12,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - idpv1alpha "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + authv1alpha "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" pinnipedfake "go.pinniped.dev/generated/1.19/client/clientset/versioned/fake" pinnipedinformers "go.pinniped.dev/generated/1.19/client/informers/externalversions" "go.pinniped.dev/internal/controller/identityprovider/idpcache" @@ -24,19 +24,19 @@ func TestController(t *testing.T) { t.Parallel() testKey1 := idpcache.Key{ - APIGroup: "idp.concierge.pinniped.dev", + APIGroup: "authentication.concierge.pinniped.dev", Kind: "WebhookIdentityProvider", Namespace: "test-namespace", Name: "test-name-one", } testKey2 := idpcache.Key{ - APIGroup: "idp.concierge.pinniped.dev", + APIGroup: "authentication.concierge.pinniped.dev", Kind: "WebhookIdentityProvider", Namespace: "test-namespace", Name: "test-name-two", } testKeyNonwebhook := idpcache.Key{ - APIGroup: "idp.concierge.pinniped.dev", + APIGroup: "authentication.concierge.pinniped.dev", Kind: "SomeOtherIdentityProvider", Namespace: "test-namespace", Name: "test-name-one", @@ -54,7 +54,7 @@ func TestController(t *testing.T) { name: "no change", initialCache: map[idpcache.Key]idpcache.Value{testKey1: nil}, webhookIDPs: []runtime.Object{ - &idpv1alpha.WebhookIdentityProvider{ + &authv1alpha.WebhookIdentityProvider{ ObjectMeta: metav1.ObjectMeta{ Namespace: testKey1.Namespace, Name: testKey1.Name, @@ -67,13 +67,13 @@ func TestController(t *testing.T) { name: "IDPs not yet added", initialCache: nil, webhookIDPs: []runtime.Object{ - &idpv1alpha.WebhookIdentityProvider{ + &authv1alpha.WebhookIdentityProvider{ ObjectMeta: metav1.ObjectMeta{ Namespace: testKey1.Namespace, Name: testKey1.Name, }, }, - &idpv1alpha.WebhookIdentityProvider{ + &authv1alpha.WebhookIdentityProvider{ ObjectMeta: metav1.ObjectMeta{ Namespace: testKey2.Namespace, Name: testKey2.Name, @@ -90,7 +90,7 @@ func TestController(t *testing.T) { testKeyNonwebhook: nil, }, webhookIDPs: []runtime.Object{ - &idpv1alpha.WebhookIdentityProvider{ + &authv1alpha.WebhookIdentityProvider{ ObjectMeta: metav1.ObjectMeta{ Namespace: testKey1.Namespace, Name: testKey1.Name, @@ -116,7 +116,7 @@ func TestController(t *testing.T) { } testLog := testlogger.New(t) - controller := New(cache, informers.IDP().V1alpha1().WebhookIdentityProviders(), testLog) + controller := New(cache, informers.Authentication().V1alpha1().WebhookIdentityProviders(), testLog) ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() diff --git a/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller.go b/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller.go index 0f6b5539..cf664bc4 100644 --- a/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller.go +++ b/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller.go @@ -20,8 +20,8 @@ import ( clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/klog/v2" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" - idpinformers "go.pinniped.dev/generated/1.19/client/informers/externalversions/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" + idpinformers "go.pinniped.dev/generated/1.19/client/informers/externalversions/authentication/v1alpha1" pinnipedcontroller "go.pinniped.dev/internal/controller" "go.pinniped.dev/internal/controller/identityprovider/idpcache" "go.pinniped.dev/internal/controllerlib" @@ -69,7 +69,7 @@ func (c *controller) Sync(ctx controllerlib.Context) error { } c.cache.Store(idpcache.Key{ - APIGroup: idpv1alpha1.GroupName, + APIGroup: auth1alpha1.GroupName, Kind: "WebhookIdentityProvider", Namespace: ctx.Key.Namespace, Name: ctx.Key.Name, @@ -81,7 +81,7 @@ func (c *controller) Sync(ctx controllerlib.Context) error { // newWebhookAuthenticator creates a webhook from the provided API server url and caBundle // used to validate TLS connections. func newWebhookAuthenticator( - spec *idpv1alpha1.WebhookIdentityProviderSpec, + spec *auth1alpha1.WebhookIdentityProviderSpec, tempfileFunc func(string, string) (*os.File, error), marshalFunc func(clientcmdapi.Config, string) error, ) (*webhook.WebhookTokenAuthenticator, error) { @@ -122,7 +122,7 @@ func newWebhookAuthenticator( return webhook.New(temp.Name(), version, implicitAuds, customDial) } -func getCABundle(spec *idpv1alpha1.TLSSpec) ([]byte, error) { +func getCABundle(spec *auth1alpha1.TLSSpec) ([]byte, error) { if spec == nil { return nil, nil } diff --git a/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller_test.go b/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller_test.go index b46b3281..8172e7f4 100644 --- a/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller_test.go +++ b/internal/controller/identityprovider/webhookcachefiller/webhookcachefiller_test.go @@ -19,7 +19,7 @@ import ( "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" pinnipedfake "go.pinniped.dev/generated/1.19/client/clientset/versioned/fake" pinnipedinformers "go.pinniped.dev/generated/1.19/client/informers/externalversions" "go.pinniped.dev/internal/controller/identityprovider/idpcache" @@ -50,12 +50,12 @@ func TestController(t *testing.T) { name: "invalid webhook", syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, webhookIDPs: []runtime.Object{ - &idpv1alpha1.WebhookIdentityProvider{ + &auth1alpha1.WebhookIdentityProvider{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test-namespace", Name: "test-name", }, - Spec: idpv1alpha1.WebhookIdentityProviderSpec{ + Spec: auth1alpha1.WebhookIdentityProviderSpec{ Endpoint: "invalid url", }, }, @@ -66,14 +66,14 @@ func TestController(t *testing.T) { name: "valid webhook", syncKey: controllerlib.Key{Namespace: "test-namespace", Name: "test-name"}, webhookIDPs: []runtime.Object{ - &idpv1alpha1.WebhookIdentityProvider{ + &auth1alpha1.WebhookIdentityProvider{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test-namespace", Name: "test-name", }, - Spec: idpv1alpha1.WebhookIdentityProviderSpec{ + Spec: auth1alpha1.WebhookIdentityProviderSpec{ Endpoint: "https://example.com", - TLS: &idpv1alpha1.TLSSpec{CertificateAuthorityData: ""}, + TLS: &auth1alpha1.TLSSpec{CertificateAuthorityData: ""}, }, }, }, @@ -93,7 +93,7 @@ func TestController(t *testing.T) { cache := idpcache.New() testLog := testlogger.New(t) - controller := New(cache, informers.IDP().V1alpha1().WebhookIdentityProviders(), testLog) + controller := New(cache, informers.Authentication().V1alpha1().WebhookIdentityProviders(), testLog) ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() @@ -124,22 +124,22 @@ func TestNewWebhookAuthenticator(t *testing.T) { t.Run("marshal failure", func(t *testing.T) { marshalError := func(_ clientcmdapi.Config, _ string) error { return fmt.Errorf("some marshal error") } - res, err := newWebhookAuthenticator(&idpv1alpha1.WebhookIdentityProviderSpec{}, ioutil.TempFile, marshalError) + res, err := newWebhookAuthenticator(&auth1alpha1.WebhookIdentityProviderSpec{}, ioutil.TempFile, marshalError) require.Nil(t, res) require.EqualError(t, err, "unable to marshal kubeconfig: some marshal error") }) t.Run("invalid base64", func(t *testing.T) { - res, err := newWebhookAuthenticator(&idpv1alpha1.WebhookIdentityProviderSpec{ + res, err := newWebhookAuthenticator(&auth1alpha1.WebhookIdentityProviderSpec{ Endpoint: "https://example.com", - TLS: &idpv1alpha1.TLSSpec{CertificateAuthorityData: "invalid-base64"}, + TLS: &auth1alpha1.TLSSpec{CertificateAuthorityData: "invalid-base64"}, }, ioutil.TempFile, clientcmd.WriteToFile) require.Nil(t, res) require.EqualError(t, err, "invalid TLS configuration: illegal base64 data at input byte 7") }) t.Run("valid config with no TLS spec", func(t *testing.T) { - res, err := newWebhookAuthenticator(&idpv1alpha1.WebhookIdentityProviderSpec{ + res, err := newWebhookAuthenticator(&auth1alpha1.WebhookIdentityProviderSpec{ Endpoint: "https://example.com", }, ioutil.TempFile, clientcmd.WriteToFile) require.NotNil(t, res) @@ -154,9 +154,9 @@ func TestNewWebhookAuthenticator(t *testing.T) { _, err = w.Write([]byte(`{}`)) require.NoError(t, err) }) - spec := &idpv1alpha1.WebhookIdentityProviderSpec{ + spec := &auth1alpha1.WebhookIdentityProviderSpec{ Endpoint: url, - TLS: &idpv1alpha1.TLSSpec{ + TLS: &auth1alpha1.TLSSpec{ CertificateAuthorityData: base64.StdEncoding.EncodeToString([]byte(caBundle)), }, } diff --git a/internal/controllermanager/prepare_controllers.go b/internal/controllermanager/prepare_controllers.go index e4bb8b32..228551e1 100644 --- a/internal/controllermanager/prepare_controllers.go +++ b/internal/controllermanager/prepare_controllers.go @@ -232,7 +232,7 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { WithController( webhookcachefiller.New( c.IDPCache, - informers.installationNamespacePinniped.IDP().V1alpha1().WebhookIdentityProviders(), + informers.installationNamespacePinniped.Authentication().V1alpha1().WebhookIdentityProviders(), klogr.New(), ), singletonWorker, @@ -240,7 +240,7 @@ func PrepareControllers(c *Config) (func(ctx context.Context), error) { WithController( webhookcachecleaner.New( c.IDPCache, - informers.installationNamespacePinniped.IDP().V1alpha1().WebhookIdentityProviders(), + informers.installationNamespacePinniped.Authentication().V1alpha1().WebhookIdentityProviders(), klogr.New(), ), singletonWorker, diff --git a/test/integration/concierge_credentialrequest_test.go b/test/integration/concierge_credentialrequest_test.go index b4504cd8..fdf240ce 100644 --- a/test/integration/concierge_credentialrequest_test.go +++ b/test/integration/concierge_credentialrequest_test.go @@ -16,7 +16,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" loginv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/login/v1alpha1" "go.pinniped.dev/test/library" ) @@ -28,7 +28,7 @@ func TestUnsuccessfulCredentialRequest(t *testing.T) { defer cancel() response, err := makeRequest(ctx, t, validCredentialRequestSpecWithRealToken(t, corev1.TypedLocalObjectReference{ - APIGroup: &idpv1alpha1.SchemeGroupVersion.Group, + APIGroup: &auth1alpha1.SchemeGroupVersion.Group, Kind: "WebhookIdentityProvider", Name: "some-webhook-that-does-not-exist", })) diff --git a/test/integration/kube_api_discovery_test.go b/test/integration/kube_api_discovery_test.go index 473cc682..6facc829 100644 --- a/test/integration/kube_api_discovery_test.go +++ b/test/integration/kube_api_discovery_test.go @@ -91,20 +91,20 @@ func TestGetAPIResourceList(t *testing.T) { }, { group: metav1.APIGroup{ - Name: "idp.concierge.pinniped.dev", + Name: "authentication.concierge.pinniped.dev", Versions: []metav1.GroupVersionForDiscovery{ { - GroupVersion: "idp.concierge.pinniped.dev/v1alpha1", + GroupVersion: "authentication.concierge.pinniped.dev/v1alpha1", Version: "v1alpha1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ - GroupVersion: "idp.concierge.pinniped.dev/v1alpha1", + GroupVersion: "authentication.concierge.pinniped.dev/v1alpha1", Version: "v1alpha1", }, }, resourceByVersion: map[string][]metav1.APIResource{ - "idp.concierge.pinniped.dev/v1alpha1": { + "authentication.concierge.pinniped.dev/v1alpha1": { { Name: "webhookidentityproviders", SingularName: "webhookidentityprovider", diff --git a/test/library/client.go b/test/library/client.go index 50aa9057..285968f9 100644 --- a/test/library/client.go +++ b/test/library/client.go @@ -23,7 +23,7 @@ import ( "k8s.io/client-go/tools/clientcmd" aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" configv1alpha1 "go.pinniped.dev/generated/1.19/apis/config/v1alpha1" pinnipedclientset "go.pinniped.dev/generated/1.19/client/clientset/versioned" @@ -127,12 +127,12 @@ func CreateTestWebhookIDP(ctx context.Context, t *testing.T) corev1.TypedLocalOb testEnv := IntegrationEnv(t) client := NewPinnipedClientset(t) - webhooks := client.IDPV1alpha1().WebhookIdentityProviders(testEnv.ConciergeNamespace) + webhooks := client.AuthenticationV1alpha1().WebhookIdentityProviders(testEnv.ConciergeNamespace) createContext, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() - idp, err := webhooks.Create(createContext, &idpv1alpha1.WebhookIdentityProvider{ + idp, err := webhooks.Create(createContext, &auth1alpha1.WebhookIdentityProvider{ ObjectMeta: metav1.ObjectMeta{ GenerateName: "test-webhook-", Labels: map[string]string{"pinniped.dev/test": ""}, @@ -153,7 +153,7 @@ func CreateTestWebhookIDP(ctx context.Context, t *testing.T) corev1.TypedLocalOb }) return corev1.TypedLocalObjectReference{ - APIGroup: &idpv1alpha1.SchemeGroupVersion.Group, + APIGroup: &auth1alpha1.SchemeGroupVersion.Group, Kind: "WebhookIdentityProvider", Name: idp.Name, } diff --git a/test/library/env.go b/test/library/env.go index 1ed59e1a..da5afb34 100644 --- a/test/library/env.go +++ b/test/library/env.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "sigs.k8s.io/yaml" - idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/idp/v1alpha1" + auth1alpha1 "go.pinniped.dev/generated/1.19/apis/concierge/authentication/v1alpha1" ) type Capability string @@ -33,7 +33,7 @@ type TestEnv struct { SupervisorCustomLabels map[string]string `json:"supervisorCustomLabels"` ConciergeCustomLabels map[string]string `json:"conciergeCustomLabels"` Capabilities map[Capability]bool `json:"capabilities"` - TestWebhook idpv1alpha1.WebhookIdentityProviderSpec `json:"testWebhook"` + TestWebhook auth1alpha1.WebhookIdentityProviderSpec `json:"testWebhook"` SupervisorHTTPAddress string `json:"supervisorHttpAddress"` SupervisorHTTPSAddress string `json:"supervisorHttpsAddress"` SupervisorHTTPSIngressAddress string `json:"supervisorHttpsIngressAddress"` @@ -100,7 +100,7 @@ func loadEnvVars(t *testing.T, result *TestEnv) { result.TestWebhook.Endpoint = needEnv(t, "PINNIPED_TEST_WEBHOOK_ENDPOINT") result.SupervisorNamespace = needEnv(t, "PINNIPED_TEST_SUPERVISOR_NAMESPACE") result.SupervisorAppName = needEnv(t, "PINNIPED_TEST_SUPERVISOR_APP_NAME") - result.TestWebhook.TLS = &idpv1alpha1.TLSSpec{CertificateAuthorityData: needEnv(t, "PINNIPED_TEST_WEBHOOK_CA_BUNDLE")} + result.TestWebhook.TLS = &auth1alpha1.TLSSpec{CertificateAuthorityData: needEnv(t, "PINNIPED_TEST_WEBHOOK_CA_BUNDLE")} result.SupervisorHTTPAddress = os.Getenv("PINNIPED_TEST_SUPERVISOR_HTTP_ADDRESS") result.SupervisorHTTPSIngressAddress = os.Getenv("PINNIPED_TEST_SUPERVISOR_HTTPS_INGRESS_ADDRESS")