Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIWI API endpoints #3608

Merged
merged 26 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
46db8d6
Add Cosmos DB container for PlatformWorkloadIdentityRoleSets
kimorris27 May 13, 2024
82958cc
Revert change to AKS k8s version - committed by mistake
kimorris27 May 15, 2024
ae00e62
Fix bug in converter
kimorris27 May 21, 2024
288c1c7
Add the PlatformWorkloadIdentityRoleSetConverter to the API register
kimorris27 May 21, 2024
3bf910c
Implement the change feed for role sets in the easiest, most naive way
kimorris27 May 21, 2024
3d74980
Implement the external API endpoint for listing role sets
kimorris27 May 21, 2024
4e214cf
Fix a small oversight from earlier on
kimorris27 May 22, 2024
cb91f12
Add unit tests for the list endpoint
kimorris27 May 22, 2024
3348774
Add unit tests for changefeed changes
kimorris27 May 28, 2024
61d643c
Uncomment the static validator
kimorris27 May 30, 2024
3cb6965
Fix more slice out of bounds bugs in the converters...
kimorris27 May 30, 2024
b3cccb1
Add converter and static validator to the admin API register
kimorris27 May 30, 2024
dd592e1
Add list and put endpoints
kimorris27 May 30, 2024
8c76e96
Fix name of function to match convention
kimorris27 May 30, 2024
f1f1569
Fix bug in static validator
kimorris27 May 31, 2024
3bf8c1f
Add unit tests for new API endpoints
kimorris27 May 31, 2024
071294b
Fix typo
kimorris27 May 31, 2024
93f970f
Appease the linter
kimorris27 May 31, 2024
15a1fde
Appease the linter
kimorris27 May 31, 2024
8476463
Add TODO comment re: the number of parameters
kimorris27 Jun 3, 2024
dbf6867
Update static validator to return multiple validation issues at the s…
kimorris27 Jun 4, 2024
7f67b55
Add a simple utility function to make semver comparisons of OpenShift…
kimorris27 Jun 4, 2024
90d2819
Log error before returning 500 to user
kimorris27 Jun 4, 2024
36e847c
Log errors before returning 500 to user
kimorris27 Jun 4, 2024
35274fb
Improve naming of unit test cases
kimorris27 Jun 5, 2024
d7e58e2
Add additional unit test cases
kimorris27 Jun 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/aro/rp.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ func rp(ctx context.Context, log, audit *logrus.Entry) error {
return err
}

dbPlatformWorkloadIdentityRoleSets, err := database.NewPlatformWorkloadIdentityRoleSets(ctx, dbc, dbName)
if err != nil {
return err
}

go database.EmitMetrics(ctx, log, dbOpenShiftClusters, metrics)

feAead, err := encryption.NewMulti(ctx, _env.ServiceKeyvault(), env.FrontendEncryptionSecretV2Name, env.FrontendEncryptionSecretName)
Expand All @@ -173,7 +178,7 @@ func rp(ctx context.Context, log, audit *logrus.Entry) error {
if err != nil {
return err
}
f, err := frontend.NewFrontend(ctx, audit, log.WithField("component", "frontend"), _env, dbAsyncOperations, dbClusterManagerConfiguration, dbOpenShiftClusters, dbSubscriptions, dbOpenShiftVersions, api.APIs, metrics, clusterm, feAead, hiveClusterManager, adminactions.NewKubeActions, adminactions.NewAzureActions, clusterdata.NewParallelEnricher(metrics, _env))
f, err := frontend.NewFrontend(ctx, audit, log.WithField("component", "frontend"), _env, dbAsyncOperations, dbClusterManagerConfiguration, dbOpenShiftClusters, dbSubscriptions, dbOpenShiftVersions, dbPlatformWorkloadIdentityRoleSets, api.APIs, metrics, clusterm, feAead, hiveClusterManager, adminactions.NewKubeActions, adminactions.NewAzureActions, clusterdata.NewParallelEnricher(metrics, _env))
kimorris27 marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/api/admin/platformworkloadidentityroleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ type PlatformWorkloadIdentityRoleSetProperties struct {
// PlatformWorkloadIdentityRole represents a mapping from a particular OCP operator to the built-in role that should be assigned to that operator's corresponding managed identity.
type PlatformWorkloadIdentityRole struct {
// OperatorName represents the name of the operator that this role is for.
OperatorName string `json:"operatorName,omitempty" mutable:"true"`
OperatorName string `json:"operatorName,omitempty" mutable:"true" validate:"required"`

// RoleDefinitionName represents the name of the role.
RoleDefinitionName string `json:"roleDefinitionName,omitempty" mutable:"true"`
RoleDefinitionName string `json:"roleDefinitionName,omitempty" mutable:"true" validate:"required"`

// RoleDefinitionID represents the resource ID of the role definition.
RoleDefinitionID string `json:"roleDefinitionId,omitempty" mutable:"true"`
RoleDefinitionID string `json:"roleDefinitionId,omitempty" mutable:"true" validate:"required"`

// ServiceAccounts represents the set of service accounts associated with the given operator, since each service account needs its own federated credential.
ServiceAccounts []string `json:"serviceAccounts,omitempty" mutable:"true"`
ServiceAccounts []string `json:"serviceAccounts,omitempty" mutable:"true" validate:"required"`
}
40 changes: 24 additions & 16 deletions pkg/api/admin/platformworkloadidentityroleset_convert.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package admin

import "github.com/Azure/ARO-RP/pkg/api"

// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.

/*
TODO: Uncomment once API endpoints have been implemented and this code is being used.

type platformWorkloadIdentityRoleSetConverter struct{}

// platformWorkloadIdentityRoleSetConverter.ToExternal returns a new external representation
Expand All @@ -21,12 +20,17 @@ func (c platformWorkloadIdentityRoleSetConverter) ToExternal(s *api.PlatformWork
},
}

for i, r := range s.Properties.PlatformWorkloadIdentityRoles {
out.Properties.PlatformWorkloadIdentityRoles[i].OperatorName = r.OperatorName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionName = r.RoleDefinitionName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionID = r.RoleDefinitionID
out.Properties.PlatformWorkloadIdentityRoles[i].ServiceAccounts = make([]string, 0, len(r.ServiceAccounts))
out.Properties.PlatformWorkloadIdentityRoles[i].ServiceAccounts = append(out.Properties.PlatformWorkloadIdentityRoles[i].ServiceAccounts, r.ServiceAccounts...)
for _, r := range s.Properties.PlatformWorkloadIdentityRoles {
role := PlatformWorkloadIdentityRole{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: space between PlatformWorkloadIdentityRole and {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put a space before the curly brace if for example this were line 23 and I had left out the space after the range expression, but I think it's normal Go style to avoid leaving blank space in that spot in a struct literal, and that's what's done throughout the codebase.

OperatorName: r.OperatorName,
hlipsig marked this conversation as resolved.
Show resolved Hide resolved
RoleDefinitionName: r.RoleDefinitionName,
RoleDefinitionID: r.RoleDefinitionID,
ServiceAccounts: make([]string, 0, len(r.ServiceAccounts)),
}

role.ServiceAccounts = append(role.ServiceAccounts, r.ServiceAccounts...)

out.Properties.PlatformWorkloadIdentityRoles = append(out.Properties.PlatformWorkloadIdentityRoles, role)
}

return out
Expand Down Expand Up @@ -56,12 +60,16 @@ func (c platformWorkloadIdentityRoleSetConverter) ToInternal(_new interface{}, o
out.Properties.OpenShiftVersion = new.Properties.OpenShiftVersion
out.Properties.PlatformWorkloadIdentityRoles = make([]api.PlatformWorkloadIdentityRole, 0, len(new.Properties.PlatformWorkloadIdentityRoles))

for i, r := range new.Properties.PlatformWorkloadIdentityRoles {
out.Properties.PlatformWorkloadIdentityRoles[i].OperatorName = r.OperatorName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionName = r.RoleDefinitionName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionID = r.RoleDefinitionID
out.Properties.PlatformWorkloadIdentityRoles[i].ServiceAccounts = make([]string, 0, len(r.ServiceAccounts))
out.Properties.PlatformWorkloadIdentityRoles[i].ServiceAccounts = append(out.Properties.PlatformWorkloadIdentityRoles[i].ServiceAccounts, r.ServiceAccounts...)
for _, r := range new.Properties.PlatformWorkloadIdentityRoles {
hlipsig marked this conversation as resolved.
Show resolved Hide resolved
role := api.PlatformWorkloadIdentityRole{
OperatorName: r.OperatorName,
RoleDefinitionName: r.RoleDefinitionName,
RoleDefinitionID: r.RoleDefinitionID,
ServiceAccounts: make([]string, 0, len(r.ServiceAccounts)),
}

role.ServiceAccounts = append(role.ServiceAccounts, r.ServiceAccounts...)

out.Properties.PlatformWorkloadIdentityRoles = append(out.Properties.PlatformWorkloadIdentityRoles, role)
}
}
*/
29 changes: 19 additions & 10 deletions pkg/api/admin/platformworkloadidentityroleset_validatestatic.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package admin

import (
"fmt"
"net/http"
"strings"

"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/api/util/immutable"
)

// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.

/*
TODO: Uncomment once API endpoints have been implemented and this code is being used.

type platformWorkloadIdentityRoleSetStaticValidator struct{}

func (sv platformWorkloadIdentityRoleSetStaticValidator) Static(_new interface{}, _current *api.PlatformWorkloadIdentityRoleSet) error {
Expand Down Expand Up @@ -37,27 +43,31 @@ func (sv platformWorkloadIdentityRoleSetStaticValidator) validate(new *PlatformW
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, "properties.platformWorkloadIdentityRoles", "Must be provided and must be non-empty")
}

errs := []error{}
missingProperties := []string{}

for i, r := range new.Properties.PlatformWorkloadIdentityRoles {
if r.OperatorName == "" {
errs = append(errs, api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].operatorName", i), "Must be provided"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of comparing struct fields individually, consider using this: https://github.com/go-playground/validator

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played around with it, but I don't think it's good for our static validators simply because it doesn't give the user friendly error messages that we want going to those making API requests. For example:

Key: 'PlatformWorkloadIdentityRole.OperatorName' Error:Field validation for 'OperatorName' failed on the 'required' tag

This error message would be perfectly fine for me as a regular developer of the RP, but it doesn't even include the fully qualified path of the API field presenting the issue, which won't be great for external users. (Well, I say "external users", but this is the admin API... 🙂)

I think adding it in just for this PR would create an inconsistency with respect to our error messaging and that with that in mind it would be best considered as a future refactor that we do across all of the static validators. Your thoughts?

missingProperties = append(missingProperties, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].operatorName", i))
}

if r.RoleDefinitionName == "" {
errs = append(errs, api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].roleDefinitionName", i), "Must be provided"))
missingProperties = append(missingProperties, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].roleDefinitionName", i))
}

if r.RoleDefinitionID == "" {
errs = append(errs, api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].roleDefinitionId", i), "Must be provided"))
missingProperties = append(missingProperties, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].roleDefinitionId", i))
}

if r.ServiceAccounts == nil || len(r.ServiceAccounts) == 0 {
errs = append(errs, api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].serviceAccounts", i), "Must be provided and must be non-empty"))
missingProperties = append(missingProperties, fmt.Sprintf("properties.platformWorkloadIdentityRoles[%d].serviceAccounts", i))
}
}

return errors.Join(errs...)
if len(missingProperties) > 0 {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, strings.Join(missingProperties, ", "), "Must be provided")
}

return nil
}

func (sv platformWorkloadIdentityRoleSetStaticValidator) validateDelta(new, current *PlatformWorkloadIdentityRoleSet) error {
Expand All @@ -68,4 +78,3 @@ func (sv platformWorkloadIdentityRoleSetStaticValidator) validateDelta(new, curr
}
return nil
}
*/
10 changes: 6 additions & 4 deletions pkg/api/admin/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ const APIVersion = "admin"

func init() {
api.APIs[APIVersion] = &api.Version{
OpenShiftClusterConverter: openShiftClusterConverter{},
OpenShiftClusterStaticValidator: openShiftClusterStaticValidator{},
OpenShiftVersionConverter: openShiftVersionConverter{},
OpenShiftVersionStaticValidator: openShiftVersionStaticValidator{},
OpenShiftClusterConverter: openShiftClusterConverter{},
OpenShiftClusterStaticValidator: openShiftClusterStaticValidator{},
OpenShiftVersionConverter: openShiftVersionConverter{},
OpenShiftVersionStaticValidator: openShiftVersionStaticValidator{},
PlatformWorkloadIdentityRoleSetConverter: platformWorkloadIdentityRoleSetConverter{},
PlatformWorkloadIdentityRoleSetStaticValidator: platformWorkloadIdentityRoleSetStaticValidator{},
}
}
36 changes: 24 additions & 12 deletions pkg/api/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ type OpenShiftVersionStaticValidator interface {
Static(interface{}, *OpenShiftVersion) error
}

type PlatformWorkloadIdentityRoleSetConverter interface {
ToExternal(*PlatformWorkloadIdentityRoleSet) interface{}
ToExternalList([]*PlatformWorkloadIdentityRoleSet) interface{}
ToInternal(interface{}, *PlatformWorkloadIdentityRoleSet)
}

type PlatformWorkloadIdentityRoleSetStaticValidator interface {
Static(interface{}, *PlatformWorkloadIdentityRoleSet) error
}

type SyncSetConverter interface {
ToExternal(*SyncSet) interface{}
ToExternalList([]*SyncSet) interface{}
Expand All @@ -63,18 +73,20 @@ type SecretConverter interface {

// Version is a set of endpoints implemented by each API version
type Version struct {
OpenShiftClusterConverter OpenShiftClusterConverter
OpenShiftClusterStaticValidator OpenShiftClusterStaticValidator
OpenShiftClusterCredentialsConverter OpenShiftClusterCredentialsConverter
OpenShiftClusterAdminKubeconfigConverter OpenShiftClusterAdminKubeconfigConverter
OpenShiftVersionConverter OpenShiftVersionConverter
OpenShiftVersionStaticValidator OpenShiftVersionStaticValidator
OperationList OperationList
SyncSetConverter SyncSetConverter
MachinePoolConverter MachinePoolConverter
SyncIdentityProviderConverter SyncIdentityProviderConverter
SecretConverter SecretConverter
ClusterManagerStaticValidator ClusterManagerStaticValidator
OpenShiftClusterConverter OpenShiftClusterConverter
OpenShiftClusterStaticValidator OpenShiftClusterStaticValidator
OpenShiftClusterCredentialsConverter OpenShiftClusterCredentialsConverter
OpenShiftClusterAdminKubeconfigConverter OpenShiftClusterAdminKubeconfigConverter
OpenShiftVersionConverter OpenShiftVersionConverter
OpenShiftVersionStaticValidator OpenShiftVersionStaticValidator
PlatformWorkloadIdentityRoleSetConverter PlatformWorkloadIdentityRoleSetConverter
PlatformWorkloadIdentityRoleSetStaticValidator PlatformWorkloadIdentityRoleSetStaticValidator
OperationList OperationList
SyncSetConverter SyncSetConverter
MachinePoolConverter MachinePoolConverter
SyncIdentityProviderConverter SyncIdentityProviderConverter
SecretConverter SecretConverter
ClusterManagerStaticValidator ClusterManagerStaticValidator
}

// APIs is the map of registered API versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ func (c platformWorkloadIdentityRoleSetConverter) ToExternal(s *api.PlatformWork
},
}

for i, r := range s.Properties.PlatformWorkloadIdentityRoles {
out.Properties.PlatformWorkloadIdentityRoles[i].OperatorName = r.OperatorName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionName = r.RoleDefinitionName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionID = r.RoleDefinitionID
for _, r := range s.Properties.PlatformWorkloadIdentityRoles {
role := PlatformWorkloadIdentityRole{
cadenmarchese marked this conversation as resolved.
Show resolved Hide resolved
OperatorName: r.OperatorName,
RoleDefinitionName: r.RoleDefinitionName,
RoleDefinitionID: r.RoleDefinitionID,
}
out.Properties.PlatformWorkloadIdentityRoles = append(out.Properties.PlatformWorkloadIdentityRoles, role)
}

return out
Expand Down Expand Up @@ -57,9 +60,12 @@ func (c platformWorkloadIdentityRoleSetConverter) ToInternal(_new interface{}, o
out.Properties.OpenShiftVersion = new.Properties.OpenShiftVersion
out.Properties.PlatformWorkloadIdentityRoles = make([]api.PlatformWorkloadIdentityRole, 0, len(new.Properties.PlatformWorkloadIdentityRoles))

for i, r := range new.Properties.PlatformWorkloadIdentityRoles {
out.Properties.PlatformWorkloadIdentityRoles[i].OperatorName = r.OperatorName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionName = r.RoleDefinitionName
out.Properties.PlatformWorkloadIdentityRoles[i].RoleDefinitionID = r.RoleDefinitionID
for _, r := range new.Properties.PlatformWorkloadIdentityRoles {
role := api.PlatformWorkloadIdentityRole{
cadenmarchese marked this conversation as resolved.
Show resolved Hide resolved
OperatorName: r.OperatorName,
RoleDefinitionName: r.RoleDefinitionName,
RoleDefinitionID: r.RoleDefinitionID,
}
out.Properties.PlatformWorkloadIdentityRoles = append(out.Properties.PlatformWorkloadIdentityRoles, role)
}
}
1 change: 1 addition & 0 deletions pkg/api/v20240812preview/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func init() {
OpenShiftClusterCredentialsConverter: openShiftClusterCredentialsConverter{},
OpenShiftClusterAdminKubeconfigConverter: openShiftClusterAdminKubeconfigConverter{},
OpenShiftVersionConverter: openShiftVersionConverter{},
PlatformWorkloadIdentityRoleSetConverter: platformWorkloadIdentityRoleSetConverter{},
OperationList: api.OperationList{
Operations: []api.Operation{
api.OperationResultsRead,
Expand Down
4 changes: 2 additions & 2 deletions pkg/frontend/admin_hive_clusterdeployment_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ func Test_getAdminHiveClusterDeployment(t *testing.T) {
clusterManager := mock_hive.NewMockClusterManager(controller)
clusterManager.EXPECT().GetClusterDeployment(gomock.Any(), gomock.Any()).Return(&clusterDeployment, nil).Times(tt.expectedGetClusterDeploymentCallCount)
f, err = NewFrontend(ctx, ti.audit, ti.log, _env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase,
ti.subscriptionsDatabase, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, clusterManager, nil, nil, nil)
ti.subscriptionsDatabase, nil, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, clusterManager, nil, nil, nil)
} else {
f, err = NewFrontend(ctx, ti.audit, ti.log, _env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase,
ti.subscriptionsDatabase, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, nil, nil, nil)
ti.subscriptionsDatabase, nil, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, nil, nil, nil)
}

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/admin_openshiftcluster_approvecsr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestAdminApproveCSR(t *testing.T) {
t.Fatal(err)
}

f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster) (adminactions.KubeActions, error) {
f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster) (adminactions.KubeActions, error) {
return k, nil
}, nil, nil)

Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/admin_openshiftcluster_cordonnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func TestAdminCordonUncordonNode(t *testing.T) {
t.Fatal(err)
}

f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster) (adminactions.KubeActions, error) {
f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster) (adminactions.KubeActions, error) {
return k, nil
}, nil, nil)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestAdminDeleteManagedResource(t *testing.T) {
a := mock_adminactions.NewMockAzureActions(ti.controller)
tt.mocks(tt, a)

f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster, *api.SubscriptionDocument) (adminactions.AzureActions, error) {
f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster, *api.SubscriptionDocument) (adminactions.AzureActions, error) {
return a, nil
}, nil)

Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/admin_openshiftcluster_drainnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAdminDrainNode(t *testing.T) {
t.Fatal(err)
}

f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster) (adminactions.KubeActions, error) {
f, err := NewFrontend(ctx, ti.audit, ti.log, ti.env, ti.asyncOperationsDatabase, ti.clusterManagerDatabase, ti.openShiftClustersDatabase, ti.subscriptionsDatabase, nil, nil, api.APIs, &noop.Noop{}, &noop.Noop{}, nil, nil, func(*logrus.Entry, env.Interface, *api.OpenShiftCluster) (adminactions.KubeActions, error) {
return k, nil
}, nil, nil)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ func TestAdminEtcdCertificateRenew(t *testing.T) {
ti.openShiftClustersDatabase,
ti.subscriptionsDatabase,
nil,
nil,
api.APIs,
&noop.Noop{},
&noop.Noop{},
Expand Down Expand Up @@ -753,6 +754,7 @@ func TestAdminEtcdCertificateRecovery(t *testing.T) {
ti.openShiftClustersDatabase,
ti.subscriptionsDatabase,
nil,
nil,
api.APIs,
&noop.Noop{},
&noop.Noop{},
Expand Down
1 change: 1 addition & 0 deletions pkg/frontend/admin_openshiftcluster_etcdrecovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func TestAdminEtcdRecovery(t *testing.T) {
ti.openShiftClustersDatabase,
ti.subscriptionsDatabase,
nil,
nil,
api.APIs,
&noop.Noop{},
&noop.Noop{},
Expand Down
Loading
Loading