Replace more pointer.String() with the new ptr.To()

This commit is contained in:
Ryan Richard 2023-07-28 12:46:15 -07:00
parent 519aece8a5
commit 0a21cb6d08
4 changed files with 55 additions and 55 deletions

View File

@ -20,7 +20,7 @@ import (
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
coretesting "k8s.io/client-go/testing" coretesting "k8s.io/client-go/testing"
clocktesting "k8s.io/utils/clock/testing" clocktesting "k8s.io/utils/clock/testing"
"k8s.io/utils/pointer" "k8s.io/utils/ptr"
configv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1" configv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1"
idpv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/idp/v1alpha1" idpv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/idp/v1alpha1"
@ -993,7 +993,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "cant-find-me", DisplayName: "cant-find-me",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: "cant-find-me-name", Name: "cant-find-me-name",
}, },
@ -1001,7 +1001,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "cant-find-me-either", DisplayName: "cant-find-me-either",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: "cant-find-me-either-name", Name: "cant-find-me-either-name",
}, },
@ -1009,7 +1009,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "cant-find-me-still", DisplayName: "cant-find-me-still",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "ActiveDirectoryIdentityProvider", Kind: "ActiveDirectoryIdentityProvider",
Name: "cant-find-me-still-name", Name: "cant-find-me-still-name",
}, },
@ -1054,7 +1054,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "can-find-me", DisplayName: "can-find-me",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1062,7 +1062,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "can-find-me-too", DisplayName: "can-find-me-too",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1070,7 +1070,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "can-find-me-three", DisplayName: "can-find-me-three",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "ActiveDirectoryIdentityProvider", Kind: "ActiveDirectoryIdentityProvider",
Name: adIdentityProvider.Name, Name: adIdentityProvider.Name,
}, },
@ -1123,7 +1123,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "duplicate1", DisplayName: "duplicate1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1131,7 +1131,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "duplicate1", DisplayName: "duplicate1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1139,7 +1139,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "duplicate1", DisplayName: "duplicate1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1147,7 +1147,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "unique", DisplayName: "unique",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "ActiveDirectoryIdentityProvider", Kind: "ActiveDirectoryIdentityProvider",
Name: adIdentityProvider.Name, Name: adIdentityProvider.Name,
}, },
@ -1155,7 +1155,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "duplicate2", DisplayName: "duplicate2",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1163,7 +1163,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "duplicate2", DisplayName: "duplicate2",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "ActiveDirectoryIdentityProvider", Kind: "ActiveDirectoryIdentityProvider",
Name: adIdentityProvider.Name, Name: adIdentityProvider.Name,
}, },
@ -1202,7 +1202,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("wrong.example.com"), APIGroup: ptr.To("wrong.example.com"),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1210,7 +1210,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name2", DisplayName: "name2",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(""), // empty string is wrong APIGroup: ptr.To(""), // empty string is wrong
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1226,7 +1226,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name4", DisplayName: "name4",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), // correct APIGroup: ptr.To(apiGroupSupervisor), // correct
Kind: "ActiveDirectoryIdentityProvider", Kind: "ActiveDirectoryIdentityProvider",
Name: adIdentityProvider.Name, Name: adIdentityProvider.Name,
}, },
@ -1272,7 +1272,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", // correct Kind: "OIDCIdentityProvider", // correct
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1280,7 +1280,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name2", DisplayName: "name2",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "wrong", Kind: "wrong",
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1288,7 +1288,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name3", DisplayName: "name3",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "", // empty is also wrong Kind: "", // empty is also wrong
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1330,7 +1330,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1393,7 +1393,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1557,7 +1557,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1628,7 +1628,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "not unique", DisplayName: "not unique",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: "this will not be found", Name: "this will not be found",
}, },
@ -1663,7 +1663,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "not unique", DisplayName: "not unique",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "this is wrong", Kind: "this is wrong",
Name: "foo", Name: "foo",
}, },
@ -1698,7 +1698,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("this is wrong"), APIGroup: ptr.To("this is wrong"),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: "foo", Name: "foo",
}, },
@ -1722,7 +1722,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1842,7 +1842,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name1", DisplayName: "name1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1894,7 +1894,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "name2", DisplayName: "name2",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: ldapIdentityProvider.Name, Name: ldapIdentityProvider.Name,
}, },
@ -1968,7 +1968,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "can-find-me", DisplayName: "can-find-me",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -1998,7 +1998,7 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
{ {
DisplayName: "can-find-me", DisplayName: "can-find-me",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String(apiGroupSupervisor), APIGroup: ptr.To(apiGroupSupervisor),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },

View File

@ -31,7 +31,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
utilerrors "k8s.io/apimachinery/pkg/util/errors" utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/utils/pointer" "k8s.io/utils/ptr"
authv1alpha "go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1" authv1alpha "go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1"
configv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1" configv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1"
@ -1283,7 +1283,7 @@ func TestE2EFullIntegration_Browser(t *testing.T) {
{ {
DisplayName: ldapIDPDisplayName, DisplayName: ldapIDPDisplayName,
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: createdLDAPProvider.Name, Name: createdLDAPProvider.Name,
}, },
@ -1320,7 +1320,7 @@ func TestE2EFullIntegration_Browser(t *testing.T) {
{ {
DisplayName: oidcIDPDisplayName, DisplayName: oidcIDPDisplayName,
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: createdOIDCProvider.Name, Name: createdOIDCProvider.Name,
}, },

View File

@ -15,7 +15,7 @@ import (
k8serrors "k8s.io/apimachinery/pkg/api/errors" k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/util/retry" "k8s.io/client-go/util/retry"
"k8s.io/utils/pointer" "k8s.io/utils/ptr"
"go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1" "go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1"
idpv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/idp/v1alpha1" idpv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/idp/v1alpha1"
@ -104,7 +104,7 @@ func TestSupervisorFederationDomainStatus_Disruptive(t *testing.T) {
{ {
DisplayName: "idp1", DisplayName: "idp1",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIDP1Meta.Name, Name: oidcIDP1Meta.Name,
}, },
@ -113,7 +113,7 @@ func TestSupervisorFederationDomainStatus_Disruptive(t *testing.T) {
{ {
DisplayName: "idp2", DisplayName: "idp2",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIDP2Meta.Name, Name: oidcIDP2Meta.Name,
}, },
@ -204,7 +204,7 @@ func TestSupervisorFederationDomainStatus_Disruptive(t *testing.T) {
{ {
DisplayName: "not unique", DisplayName: "not unique",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("this is the wrong api group"), APIGroup: ptr.To("this is the wrong api group"),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: "will not be found", Name: "will not be found",
}, },
@ -228,7 +228,7 @@ func TestSupervisorFederationDomainStatus_Disruptive(t *testing.T) {
{ // this identity provider should be valid { // this identity provider should be valid
DisplayName: "unique", DisplayName: "unique",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -236,7 +236,7 @@ func TestSupervisorFederationDomainStatus_Disruptive(t *testing.T) {
{ {
DisplayName: "not unique", DisplayName: "not unique",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "this is the wrong kind", Kind: "this is the wrong kind",
Name: "also will not be found", Name: "also will not be found",
}, },
@ -442,7 +442,7 @@ func TestSupervisorFederationDomainStatus_Disruptive(t *testing.T) {
DisplayName: "now made unique", DisplayName: "now made unique",
// Fix the objectRef. // Fix the objectRef.
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
}, },
@ -520,7 +520,7 @@ func TestSupervisorFederationDomainStatus_Disruptive(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
gotFD.Spec.IdentityProviders[2].ObjectRef = corev1.TypedLocalObjectReference{ gotFD.Spec.IdentityProviders[2].ObjectRef = corev1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: oidcIdentityProvider.Name, Name: oidcIdentityProvider.Name,
} }
@ -597,7 +597,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "", DisplayName: "",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
}, },
}, },
@ -618,7 +618,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Constants: []v1alpha1.FederationDomainTransformsConstant{ Constants: []v1alpha1.FederationDomainTransformsConstant{
@ -647,7 +647,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Constants: []v1alpha1.FederationDomainTransformsConstant{ Constants: []v1alpha1.FederationDomainTransformsConstant{
@ -673,7 +673,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Constants: []v1alpha1.FederationDomainTransformsConstant{ Constants: []v1alpha1.FederationDomainTransformsConstant{
@ -706,7 +706,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Constants: []v1alpha1.FederationDomainTransformsConstant{ Constants: []v1alpha1.FederationDomainTransformsConstant{
@ -748,7 +748,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Constants: []v1alpha1.FederationDomainTransformsConstant{ Constants: []v1alpha1.FederationDomainTransformsConstant{
@ -776,7 +776,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Expressions: []v1alpha1.FederationDomainTransformsExpression{ Expressions: []v1alpha1.FederationDomainTransformsExpression{
@ -805,7 +805,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Expressions: []v1alpha1.FederationDomainTransformsExpression{ Expressions: []v1alpha1.FederationDomainTransformsExpression{
@ -831,7 +831,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Examples: []v1alpha1.FederationDomainTransformsExample{ Examples: []v1alpha1.FederationDomainTransformsExample{
@ -867,7 +867,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
}, },
}, },
@ -884,7 +884,7 @@ func TestSupervisorFederationDomainCRDValidations_Parallel(t *testing.T) {
{ {
DisplayName: "foo", DisplayName: "foo",
ObjectRef: corev1.TypedLocalObjectReference{ ObjectRef: corev1.TypedLocalObjectReference{
APIGroup: pointer.String("required in older versions of Kubernetes for each item in the identityProviders slice"), APIGroup: ptr.To("required in older versions of Kubernetes for each item in the identityProviders slice"),
}, },
Transforms: v1alpha1.FederationDomainTransforms{ Transforms: v1alpha1.FederationDomainTransforms{
Constants: []v1alpha1.FederationDomainTransformsConstant{ Constants: []v1alpha1.FederationDomainTransformsConstant{

View File

@ -26,7 +26,7 @@ import (
"golang.org/x/oauth2" "golang.org/x/oauth2"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer" "k8s.io/utils/ptr"
"k8s.io/utils/strings/slices" "k8s.io/utils/strings/slices"
configv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1" configv1alpha1 "go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1"
@ -1870,7 +1870,7 @@ func TestSupervisorLogin_Browser(t *testing.T) {
{ {
DisplayName: displayName, DisplayName: displayName,
ObjectRef: v1.TypedLocalObjectReference{ ObjectRef: v1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "OIDCIdentityProvider", Kind: "OIDCIdentityProvider",
Name: idpName, Name: idpName,
}, },
@ -1927,7 +1927,7 @@ func TestSupervisorLogin_Browser(t *testing.T) {
{ {
DisplayName: displayName, DisplayName: displayName,
ObjectRef: v1.TypedLocalObjectReference{ ObjectRef: v1.TypedLocalObjectReference{
APIGroup: pointer.String("idp.supervisor." + env.APIGroupSuffix), APIGroup: ptr.To("idp.supervisor." + env.APIGroupSuffix),
Kind: "LDAPIdentityProvider", Kind: "LDAPIdentityProvider",
Name: idpName, Name: idpName,
}, },