Skip to content

Commit

Permalink
Non provider-specific changes to use wrangler over norman
Browse files Browse the repository at this point in the history
Signed-off-by: Chad Roberts <chad.roberts@suse.com>
  • Loading branch information
crobby committed Oct 22, 2024
1 parent 5aadc91 commit 0752663
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/auth/cleanup/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/auth/api/secrets"
controllers "github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io/v3"
corev1 "github.com/rancher/rancher/pkg/generated/norman/core/v1"
wcorev1 "github.com/rancher/wrangler/v3/pkg/generated/controllers/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
Expand All @@ -19,7 +19,7 @@ var errAuthConfigNil = errors.New("cannot get auth provider if its config is nil

// Service performs cleanup of resources associated with an auth provider.
type Service struct {
secretsInterface corev1.SecretInterface
secretsInterface wcorev1.SecretController

userClient controllers.UserClient

Expand All @@ -37,7 +37,7 @@ type Service struct {
}

// NewCleanupService creates and returns a new auth provider cleanup service.
func NewCleanupService(secretsInterface corev1.SecretInterface, c controllers.Interface) *Service {
func NewCleanupService(secretsInterface wcorev1.SecretController, c controllers.Interface) *Service {
return &Service{
secretsInterface: secretsInterface,

Expand Down
3 changes: 1 addition & 2 deletions pkg/auth/providers/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/rancher/norman/types"
"github.com/rancher/rancher/pkg/auth/api/secrets"
client "github.com/rancher/rancher/pkg/client/generated/management/v3"
"github.com/rancher/rancher/pkg/namespace"
managementschema "github.com/rancher/rancher/pkg/schemas/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
)
Expand All @@ -34,7 +33,7 @@ func SetupAuthConfig(ctx context.Context, management *config.ScaledContext, sche
Configure(ctx, management)

authConfigBaseSchema := schemas.Schema(&managementschema.Version, client.AuthConfigType)
authConfigBaseSchema.Store = secrets.Wrap(authConfigBaseSchema.Store, management.Core.Secrets(namespace.GlobalNamespace))
authConfigBaseSchema.Store = secrets.Wrap(authConfigBaseSchema.Store, management.Wrangler.Core.Secret())
for _, authConfigSubtype := range authConfigTypes {
subSchema := schemas.Schema(&managementschema.Version, authConfigSubtype)
GetProviderByType(authConfigSubtype).CustomizeSchema(subSchema)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/management/auth/auth_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func newAuthConfigController(context context.Context, mgmt *config.ManagementCon
controller := &authConfigController{
users: mgmt.Management.Users("").Controller().Lister(),
authRefresher: providerrefresh.NewUserAuthRefresher(context, scaledContext),
cleanup: cleanup.NewCleanupService(mgmt.Core.Secrets(""), mgmt.Wrangler.Mgmt),
cleanup: cleanup.NewCleanupService(mgmt.Wrangler.Core.Secret(), mgmt.Wrangler.Mgmt),
authConfigsUnstructured: scaledContext.Management.AuthConfigs("").ObjectClient().UnstructuredClient(),
}
return controller
Expand Down

0 comments on commit 0752663

Please # to comment.