зеркало из https://github.com/Azure/ARO-RP.git
remove roleassignments client from installer
This commit is contained in:
Родитель
bd3bddc042
Коммит
f9c7e8d900
|
@ -14,7 +14,6 @@ import (
|
|||
"github.com/jim-minter/rp/pkg/api"
|
||||
"github.com/jim-minter/rp/pkg/database"
|
||||
"github.com/jim-minter/rp/pkg/env"
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient/authorization"
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient/network"
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient/resources"
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient/storage"
|
||||
|
@ -26,7 +25,6 @@ type Installer struct {
|
|||
env env.Interface
|
||||
db database.OpenShiftClusters
|
||||
|
||||
roleassignments authorization.RoleAssignmentsClient
|
||||
disks compute.DisksClient
|
||||
virtualmachines compute.VirtualMachinesClient
|
||||
interfaces network.InterfacesClient
|
||||
|
@ -44,7 +42,6 @@ func NewInstaller(log *logrus.Entry, env env.Interface, db database.OpenShiftClu
|
|||
env: env,
|
||||
db: db,
|
||||
|
||||
roleassignments: authorization.NewRoleAssignmentsClient(subscriptionID, fpAuthorizer),
|
||||
disks: compute.NewDisksClient(subscriptionID),
|
||||
virtualmachines: compute.NewVirtualMachinesClient(subscriptionID),
|
||||
interfaces: network.NewInterfacesClient(subscriptionID, fpAuthorizer),
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
package authorization
|
||||
|
||||
//go:generate go run ../../../../vendor/github.com/golang/mock/mockgen -destination=../../mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go github.com/jim-minter/rp/pkg/util/azureclient/$GOPACKAGE RoleAssignmentsClient
|
||||
//go:generate go run ../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/jim-minter/rp -e -w ../../mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
// RoleAssignmentsClient is a minimal interface for azure RoleAssignmentsClient
|
||||
type RoleAssignmentsClient interface {
|
||||
Create(ctx context.Context, scope string, roleAssignmentName string, parameters authorization.RoleAssignmentCreateParameters) (result authorization.RoleAssignment, err error)
|
||||
}
|
||||
|
||||
type roleAssignmentsClient struct {
|
||||
authorization.RoleAssignmentsClient
|
||||
}
|
||||
|
||||
var _ RoleAssignmentsClient = &roleAssignmentsClient{}
|
||||
|
||||
// NewRoleAssignmentsClient creates a new RoleAssignmentsClient
|
||||
func NewRoleAssignmentsClient(subscriptionID string, authorizer autorest.Authorizer) RoleAssignmentsClient {
|
||||
client := authorization.NewRoleAssignmentsClient(subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
|
||||
return &roleAssignmentsClient{
|
||||
RoleAssignmentsClient: client,
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/jim-minter/rp/pkg/util/azureclient/authorization (interfaces: RoleAssignmentsClient)
|
||||
|
||||
// Package mock_authorization is a generated GoMock package.
|
||||
package mock_authorization
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
authorization "github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockRoleAssignmentsClient is a mock of RoleAssignmentsClient interface
|
||||
type MockRoleAssignmentsClient struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockRoleAssignmentsClientMockRecorder
|
||||
}
|
||||
|
||||
// MockRoleAssignmentsClientMockRecorder is the mock recorder for MockRoleAssignmentsClient
|
||||
type MockRoleAssignmentsClientMockRecorder struct {
|
||||
mock *MockRoleAssignmentsClient
|
||||
}
|
||||
|
||||
// NewMockRoleAssignmentsClient creates a new mock instance
|
||||
func NewMockRoleAssignmentsClient(ctrl *gomock.Controller) *MockRoleAssignmentsClient {
|
||||
mock := &MockRoleAssignmentsClient{ctrl: ctrl}
|
||||
mock.recorder = &MockRoleAssignmentsClientMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockRoleAssignmentsClient) EXPECT() *MockRoleAssignmentsClientMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Create mocks base method
|
||||
func (m *MockRoleAssignmentsClient) Create(arg0 context.Context, arg1, arg2 string, arg3 authorization.RoleAssignmentCreateParameters) (authorization.RoleAssignment, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(authorization.RoleAssignment)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Create indicates an expected call of Create
|
||||
func (mr *MockRoleAssignmentsClientMockRecorder) Create(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockRoleAssignmentsClient)(nil).Create), arg0, arg1, arg2, arg3)
|
||||
}
|
Загрузка…
Ссылка в новой задаче