зеркало из https://github.com/Azure/ARO-RP.git
Add more clients
This commit is contained in:
Родитель
29263d8753
Коммит
7a34f0912c
|
@ -206,7 +206,7 @@ func (i *Installer) installStorage(ctx context.Context, doc *api.OpenShiftCluste
|
|||
}
|
||||
|
||||
i.log.Print("waiting for storage template deployment")
|
||||
err = future.WaitForCompletionRef(ctx, i.deployments.Client)
|
||||
err = future.WaitForCompletionRef(ctx, i.deployments.Client())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -629,7 +629,7 @@ func (i *Installer) installResources(ctx context.Context, doc *api.OpenShiftClus
|
|||
}
|
||||
|
||||
i.log.Print("waiting for resources template deployment")
|
||||
err = future.WaitForCompletionRef(ctx, i.deployments.Client)
|
||||
err = future.WaitForCompletionRef(ctx, i.deployments.Client())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ func (i *Installer) removeBootstrap(ctx context.Context, doc *api.OpenShiftClust
|
|||
return err
|
||||
}
|
||||
|
||||
err = future.WaitForCompletionRef(ctx, i.interfaces.Client)
|
||||
err = future.WaitForCompletionRef(ctx, i.interfaces.Client())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ func (i *Installer) removeBootstrap(ctx context.Context, doc *api.OpenShiftClust
|
|||
return err
|
||||
}
|
||||
|
||||
err = future.WaitForCompletionRef(ctx, i.publicipaddresses.Client)
|
||||
err = future.WaitForCompletionRef(ctx, i.publicipaddresses.Client())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -4,14 +4,9 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute"
|
||||
"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns"
|
||||
"github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi"
|
||||
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-07-01/network"
|
||||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
|
||||
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage"
|
||||
azstorage "github.com/Azure/azure-sdk-for-go/storage"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/openshift/installer/pkg/asset/installconfig"
|
||||
|
@ -20,6 +15,10 @@ import (
|
|||
"github.com/jim-minter/rp/pkg/api"
|
||||
"github.com/jim-minter/rp/pkg/database"
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient/authorization"
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient/dns"
|
||||
"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"
|
||||
)
|
||||
|
||||
type Installer struct {
|
||||
|
@ -50,27 +49,18 @@ func NewInstaller(log *logrus.Entry, db database.OpenShiftClusters, domain strin
|
|||
roleassignments: authorization.NewRoleAssignmentsClient(subscriptionID, authorizer),
|
||||
disks: compute.NewDisksClient(subscriptionID),
|
||||
virtualmachines: compute.NewVirtualMachinesClient(subscriptionID),
|
||||
recordsets: dns.NewRecordSetsClient(subscriptionID),
|
||||
recordsets: dns.NewRecordSetsClient(subscriptionID, authorizer),
|
||||
userassignedidentities: msi.NewUserAssignedIdentitiesClient(subscriptionID),
|
||||
interfaces: network.NewInterfacesClient(subscriptionID),
|
||||
publicipaddresses: network.NewPublicIPAddressesClient(subscriptionID),
|
||||
deployments: resources.NewDeploymentsClient(subscriptionID),
|
||||
groups: resources.NewGroupsClient(subscriptionID),
|
||||
accounts: storage.NewAccountsClient(subscriptionID),
|
||||
interfaces: network.NewInterfacesClient(subscriptionID, authorizer),
|
||||
publicipaddresses: network.NewPublicIPAddressesClient(subscriptionID, authorizer),
|
||||
deployments: resources.NewDeploymentsClient(subscriptionID, authorizer),
|
||||
groups: resources.NewGroupsClient(subscriptionID, authorizer),
|
||||
accounts: storage.NewAccountsClient(subscriptionID, authorizer),
|
||||
}
|
||||
|
||||
d.disks.Authorizer = authorizer
|
||||
d.virtualmachines.Authorizer = authorizer
|
||||
d.recordsets.Authorizer = authorizer
|
||||
d.userassignedidentities.Authorizer = authorizer
|
||||
d.interfaces.Authorizer = authorizer
|
||||
d.publicipaddresses.Authorizer = authorizer
|
||||
d.deployments.Authorizer = authorizer
|
||||
d.groups.Authorizer = authorizer
|
||||
d.accounts.Authorizer = authorizer
|
||||
|
||||
d.deployments.Client.PollingDuration = time.Hour
|
||||
|
||||
return d
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package dns
|
||||
|
||||
//go:generate go run ../../../../vendor/github.com/golang/mock/mockgen -destination=../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go github.com/jim-minter/rp/pkg/util/azureclient/$GOPACKAGE RecordSetsClient
|
||||
//go:generate gofmt -s -l -w ../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go
|
||||
//go:generate go run ../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/jim-minter/rp -e -w ../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
// RecordSetsClient is a minimal interface for azure RecordSetsClient
|
||||
type RecordSetsClient interface {
|
||||
CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType dns.RecordType, parameters dns.RecordSet, ifMatch string, ifNoneMatch string) (result dns.RecordSet, err error)
|
||||
Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType dns.RecordType, ifMatch string) (result autorest.Response, err error)
|
||||
Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType dns.RecordType) (result dns.RecordSet, err error)
|
||||
}
|
||||
|
||||
type recordSetsClient struct {
|
||||
dns.RecordSetsClient
|
||||
}
|
||||
|
||||
var _ RecordSetsClient = &recordSetsClient{}
|
||||
|
||||
// NewRecordSetsClient creates a new RecordSetsClient
|
||||
func NewRecordSetsClient(subscriptionID string, authorizer autorest.Authorizer) RecordSetsClient {
|
||||
client := dns.NewRecordSetsClient(subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
|
||||
return &recordSetsClient{
|
||||
RecordSetsClient: client,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package network
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-07-01/network"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient"
|
||||
)
|
||||
|
||||
// InterfacesClient is a minimal interface for azure NewInterfacesClient
|
||||
type InterfacesClient interface {
|
||||
Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, expand string) (network.Interface, error)
|
||||
Delete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result network.InterfacesDeleteFuture, err error)
|
||||
azureclient.Client
|
||||
}
|
||||
|
||||
type interfacesClient struct {
|
||||
network.InterfacesClient
|
||||
}
|
||||
|
||||
var _ InterfacesClient = &interfacesClient{}
|
||||
|
||||
// NewInterfacesClient creates a new InterfacesClient
|
||||
func NewInterfacesClient(subscriptionID string, authorizer autorest.Authorizer) InterfacesClient {
|
||||
client := network.NewInterfacesClient(subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
|
||||
return &interfacesClient{
|
||||
InterfacesClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *interfacesClient) Client() autorest.Client {
|
||||
return c.InterfacesClient.Client
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package network
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-07-01/network"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient"
|
||||
)
|
||||
|
||||
// PublicIPAddressesClient is a minimal interface for azure NewPublicIPAddressesClient
|
||||
type PublicIPAddressesClient interface {
|
||||
Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, expand string) (network.PublicIPAddress, error)
|
||||
ListVirtualMachineScaleSetPublicIPAddressesComplete(ctx context.Context, resourceGroupName string, scaleSetName string) (network.PublicIPAddressListResultIterator, error)
|
||||
Delete(ctx context.Context, resourceGroupName string, publicIPAddressName string) (result network.PublicIPAddressesDeleteFuture, err error)
|
||||
azureclient.Client
|
||||
}
|
||||
|
||||
type publicIPAddressesClient struct {
|
||||
network.PublicIPAddressesClient
|
||||
}
|
||||
|
||||
var _ PublicIPAddressesClient = &publicIPAddressesClient{}
|
||||
|
||||
// NewPublicIPAddressesClient creates a new PublicIPAddressesClient
|
||||
func NewPublicIPAddressesClient(subscriptionID string, authorizer autorest.Authorizer) PublicIPAddressesClient {
|
||||
client := network.NewPublicIPAddressesClient(subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
|
||||
return &publicIPAddressesClient{
|
||||
PublicIPAddressesClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *publicIPAddressesClient) Client() autorest.Client {
|
||||
return c.PublicIPAddressesClient.Client
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package resources
|
||||
|
||||
//go:generate go run ../../../../vendor/github.com/golang/mock/mockgen -destination=../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go github.com/jim-minter/rp/pkg/util/azureclient/$GOPACKAGE DeploymentsClient,GroupsClient
|
||||
//go:generate gofmt -s -l -w ../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go
|
||||
//go:generate go run ../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/jim-minter/rp -e -w ../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
"github.com/jim-minter/rp/pkg/util/azureclient"
|
||||
)
|
||||
|
||||
// DeploymentsClient is a minimal interface for azure DeploymentsClient
|
||||
type DeploymentsClient interface {
|
||||
CreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters resources.Deployment) (result resources.DeploymentsCreateOrUpdateFuture, err error)
|
||||
azureclient.Client
|
||||
DeploymentsClientAddons
|
||||
}
|
||||
|
||||
type deploymentsClient struct {
|
||||
resources.DeploymentsClient
|
||||
}
|
||||
|
||||
var _ DeploymentsClient = &deploymentsClient{}
|
||||
|
||||
// NewDeploymentsClient creates a new DeploymentsClient
|
||||
func NewDeploymentsClient(subscriptionID string, authorizer autorest.Authorizer) DeploymentsClient {
|
||||
client := resources.NewDeploymentsClient(subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
client.PollingDuration = time.Hour
|
||||
|
||||
return &deploymentsClient{
|
||||
DeploymentsClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *deploymentsClient) Client() autorest.Client {
|
||||
return c.DeploymentsClient.Client
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package resources
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
|
||||
)
|
||||
|
||||
type DeploymentsClientAddons interface {
|
||||
CreateOrUpdateAndWait(ctx context.Context, resourceGroupName string, deploymentName string, parameters resources.Deployment) error
|
||||
}
|
||||
|
||||
func (c *deploymentsClient) CreateOrUpdateAndWait(ctx context.Context, resourceGroupName string, deploymentName string, parameters resources.Deployment) error {
|
||||
future, err := c.DeploymentsClient.CreateOrUpdate(ctx, resourceGroupName, deploymentName, parameters)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return future.WaitForCompletionRef(ctx, c.DeploymentsClient.Client)
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package resources
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
// GroupsClient is a minimal interface for azure Resources Client
|
||||
type GroupsClient interface {
|
||||
CreateOrUpdate(ctx context.Context, resourceGroupName string, parameters resources.Group) (result resources.Group, err error)
|
||||
Get(ctx context.Context, resourceGroupName string) (result resources.Group, err error)
|
||||
GroupsClientAddons
|
||||
}
|
||||
|
||||
type groupsClient struct {
|
||||
resources.GroupsClient
|
||||
}
|
||||
|
||||
var _ GroupsClient = &groupsClient{}
|
||||
|
||||
// NewGroupsClient creates a new ResourcesClient
|
||||
func NewGroupsClient(subscriptionID string, authorizer autorest.Authorizer) GroupsClient {
|
||||
client := resources.NewGroupsClient(subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
|
||||
return &groupsClient{
|
||||
GroupsClient: client,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package resources
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type GroupsClientAddons interface {
|
||||
Delete(ctx context.Context, resourceGroupName string) (err error)
|
||||
}
|
||||
|
||||
func (c *groupsClient) Delete(ctx context.Context, resourceGroupName string) (err error) {
|
||||
future, err := c.GroupsClient.Delete(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return future.WaitForCompletionRef(ctx, c.GroupsClient.Client)
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package storage
|
||||
|
||||
//go:generate go run ../../../../vendor/github.com/golang/mock/mockgen -destination=../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go github.com/jim-minter/rp/pkg/util/azureclient/$GOPACKAGE AccountsClient
|
||||
//go:generate gofmt -s -l -w ../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go
|
||||
//go:generate go run ../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/jim-minter/rp -e -w ../../../util/mocks/mock_azureclient/mock_$GOPACKAGE/$GOPACKAGE.go
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
// AccountsClient is a minimal interface for azure AccountsClient
|
||||
type AccountsClient interface {
|
||||
ListKeys(ctx context.Context, resourceGroupName string, accountName string, expand storage.ListKeyExpand) (result storage.AccountListKeysResult, err error)
|
||||
ListByResourceGroup(context context.Context, resourceGroup string) (storage.AccountListResult, error)
|
||||
AccountsClientAddons
|
||||
}
|
||||
|
||||
func (a *accountsClient) Client() autorest.Client {
|
||||
return a.AccountsClient.Client
|
||||
}
|
||||
|
||||
type accountsClient struct {
|
||||
storage.AccountsClient
|
||||
}
|
||||
|
||||
var _ AccountsClient = &accountsClient{}
|
||||
|
||||
// NewAccountsClient returns a new AccountsClient
|
||||
func NewAccountsClient(subscriptionID string, authorizer autorest.Authorizer) AccountsClient {
|
||||
client := storage.NewAccountsClient(subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
|
||||
return &accountsClient{
|
||||
AccountsClient: client,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package storage
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage"
|
||||
)
|
||||
|
||||
type AccountsClientAddons interface {
|
||||
Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) error
|
||||
}
|
||||
|
||||
func (c *accountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) error {
|
||||
future, err := c.AccountsClient.Create(ctx, resourceGroupName, accountName, parameters)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return future.WaitForCompletionRef(ctx, c.AccountsClient.Client)
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/jim-minter/rp/pkg/util/azureclient/dns (interfaces: RecordSetsClient)
|
||||
|
||||
// Package mock_dns is a generated GoMock package.
|
||||
package mock_dns
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
dns "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns"
|
||||
autorest "github.com/Azure/go-autorest/autorest"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockRecordSetsClient is a mock of RecordSetsClient interface
|
||||
type MockRecordSetsClient struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockRecordSetsClientMockRecorder
|
||||
}
|
||||
|
||||
// MockRecordSetsClientMockRecorder is the mock recorder for MockRecordSetsClient
|
||||
type MockRecordSetsClientMockRecorder struct {
|
||||
mock *MockRecordSetsClient
|
||||
}
|
||||
|
||||
// NewMockRecordSetsClient creates a new mock instance
|
||||
func NewMockRecordSetsClient(ctrl *gomock.Controller) *MockRecordSetsClient {
|
||||
mock := &MockRecordSetsClient{ctrl: ctrl}
|
||||
mock.recorder = &MockRecordSetsClientMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockRecordSetsClient) EXPECT() *MockRecordSetsClientMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// CreateOrUpdate mocks base method
|
||||
func (m *MockRecordSetsClient) CreateOrUpdate(arg0 context.Context, arg1, arg2, arg3 string, arg4 dns.RecordType, arg5 dns.RecordSet, arg6, arg7 string) (dns.RecordSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CreateOrUpdate", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
ret0, _ := ret[0].(dns.RecordSet)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// CreateOrUpdate indicates an expected call of CreateOrUpdate
|
||||
func (mr *MockRecordSetsClientMockRecorder) CreateOrUpdate(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockRecordSetsClient)(nil).CreateOrUpdate), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
|
||||
// Delete mocks base method
|
||||
func (m *MockRecordSetsClient) Delete(arg0 context.Context, arg1, arg2, arg3 string, arg4 dns.RecordType, arg5 string) (autorest.Response, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delete", arg0, arg1, arg2, arg3, arg4, arg5)
|
||||
ret0, _ := ret[0].(autorest.Response)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Delete indicates an expected call of Delete
|
||||
func (mr *MockRecordSetsClientMockRecorder) Delete(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockRecordSetsClient)(nil).Delete), arg0, arg1, arg2, arg3, arg4, arg5)
|
||||
}
|
||||
|
||||
// Get mocks base method
|
||||
func (m *MockRecordSetsClient) Get(arg0 context.Context, arg1, arg2, arg3 string, arg4 dns.RecordType) (dns.RecordSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2, arg3, arg4)
|
||||
ret0, _ := ret[0].(dns.RecordSet)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Get indicates an expected call of Get
|
||||
func (mr *MockRecordSetsClientMockRecorder) Get(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockRecordSetsClient)(nil).Get), arg0, arg1, arg2, arg3, arg4)
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/jim-minter/rp/pkg/util/azureclient/resources (interfaces: DeploymentsClient,GroupsClient)
|
||||
|
||||
// Package mock_resources is a generated GoMock package.
|
||||
package mock_resources
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
resources "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
|
||||
autorest "github.com/Azure/go-autorest/autorest"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockDeploymentsClient is a mock of DeploymentsClient interface
|
||||
type MockDeploymentsClient struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockDeploymentsClientMockRecorder
|
||||
}
|
||||
|
||||
// MockDeploymentsClientMockRecorder is the mock recorder for MockDeploymentsClient
|
||||
type MockDeploymentsClientMockRecorder struct {
|
||||
mock *MockDeploymentsClient
|
||||
}
|
||||
|
||||
// NewMockDeploymentsClient creates a new mock instance
|
||||
func NewMockDeploymentsClient(ctrl *gomock.Controller) *MockDeploymentsClient {
|
||||
mock := &MockDeploymentsClient{ctrl: ctrl}
|
||||
mock.recorder = &MockDeploymentsClientMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockDeploymentsClient) EXPECT() *MockDeploymentsClientMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Client mocks base method
|
||||
func (m *MockDeploymentsClient) Client() autorest.Client {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Client")
|
||||
ret0, _ := ret[0].(autorest.Client)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Client indicates an expected call of Client
|
||||
func (mr *MockDeploymentsClientMockRecorder) Client() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Client", reflect.TypeOf((*MockDeploymentsClient)(nil).Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdate mocks base method
|
||||
func (m *MockDeploymentsClient) CreateOrUpdate(arg0 context.Context, arg1, arg2 string, arg3 resources.Deployment) (resources.DeploymentsCreateOrUpdateFuture, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CreateOrUpdate", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(resources.DeploymentsCreateOrUpdateFuture)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// CreateOrUpdate indicates an expected call of CreateOrUpdate
|
||||
func (mr *MockDeploymentsClientMockRecorder) CreateOrUpdate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockDeploymentsClient)(nil).CreateOrUpdate), arg0, arg1, arg2, arg3)
|
||||
}
|
||||
|
||||
// CreateOrUpdateAndWait mocks base method
|
||||
func (m *MockDeploymentsClient) CreateOrUpdateAndWait(arg0 context.Context, arg1, arg2 string, arg3 resources.Deployment) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CreateOrUpdateAndWait", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// CreateOrUpdateAndWait indicates an expected call of CreateOrUpdateAndWait
|
||||
func (mr *MockDeploymentsClientMockRecorder) CreateOrUpdateAndWait(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateAndWait", reflect.TypeOf((*MockDeploymentsClient)(nil).CreateOrUpdateAndWait), arg0, arg1, arg2, arg3)
|
||||
}
|
||||
|
||||
// MockGroupsClient is a mock of GroupsClient interface
|
||||
type MockGroupsClient struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockGroupsClientMockRecorder
|
||||
}
|
||||
|
||||
// MockGroupsClientMockRecorder is the mock recorder for MockGroupsClient
|
||||
type MockGroupsClientMockRecorder struct {
|
||||
mock *MockGroupsClient
|
||||
}
|
||||
|
||||
// NewMockGroupsClient creates a new mock instance
|
||||
func NewMockGroupsClient(ctrl *gomock.Controller) *MockGroupsClient {
|
||||
mock := &MockGroupsClient{ctrl: ctrl}
|
||||
mock.recorder = &MockGroupsClientMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockGroupsClient) EXPECT() *MockGroupsClientMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// CreateOrUpdate mocks base method
|
||||
func (m *MockGroupsClient) CreateOrUpdate(arg0 context.Context, arg1 string, arg2 resources.Group) (resources.Group, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CreateOrUpdate", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(resources.Group)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// CreateOrUpdate indicates an expected call of CreateOrUpdate
|
||||
func (mr *MockGroupsClientMockRecorder) CreateOrUpdate(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockGroupsClient)(nil).CreateOrUpdate), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// Delete mocks base method
|
||||
func (m *MockGroupsClient) Delete(arg0 context.Context, arg1 string) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delete", arg0, arg1)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Delete indicates an expected call of Delete
|
||||
func (mr *MockGroupsClientMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockGroupsClient)(nil).Delete), arg0, arg1)
|
||||
}
|
||||
|
||||
// Get mocks base method
|
||||
func (m *MockGroupsClient) Get(arg0 context.Context, arg1 string) (resources.Group, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Get", arg0, arg1)
|
||||
ret0, _ := ret[0].(resources.Group)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Get indicates an expected call of Get
|
||||
func (mr *MockGroupsClientMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockGroupsClient)(nil).Get), arg0, arg1)
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/jim-minter/rp/pkg/util/azureclient/storage (interfaces: AccountsClient)
|
||||
|
||||
// Package mock_storage is a generated GoMock package.
|
||||
package mock_storage
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
storage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockAccountsClient is a mock of AccountsClient interface
|
||||
type MockAccountsClient struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockAccountsClientMockRecorder
|
||||
}
|
||||
|
||||
// MockAccountsClientMockRecorder is the mock recorder for MockAccountsClient
|
||||
type MockAccountsClientMockRecorder struct {
|
||||
mock *MockAccountsClient
|
||||
}
|
||||
|
||||
// NewMockAccountsClient creates a new mock instance
|
||||
func NewMockAccountsClient(ctrl *gomock.Controller) *MockAccountsClient {
|
||||
mock := &MockAccountsClient{ctrl: ctrl}
|
||||
mock.recorder = &MockAccountsClientMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockAccountsClient) EXPECT() *MockAccountsClientMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Create mocks base method
|
||||
func (m *MockAccountsClient) Create(arg0 context.Context, arg1, arg2 string, arg3 storage.AccountCreateParameters) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Create indicates an expected call of Create
|
||||
func (mr *MockAccountsClientMockRecorder) Create(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockAccountsClient)(nil).Create), arg0, arg1, arg2, arg3)
|
||||
}
|
||||
|
||||
// ListByResourceGroup mocks base method
|
||||
func (m *MockAccountsClient) ListByResourceGroup(arg0 context.Context, arg1 string) (storage.AccountListResult, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ListByResourceGroup", arg0, arg1)
|
||||
ret0, _ := ret[0].(storage.AccountListResult)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ListByResourceGroup indicates an expected call of ListByResourceGroup
|
||||
func (mr *MockAccountsClientMockRecorder) ListByResourceGroup(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByResourceGroup", reflect.TypeOf((*MockAccountsClient)(nil).ListByResourceGroup), arg0, arg1)
|
||||
}
|
||||
|
||||
// ListKeys mocks base method
|
||||
func (m *MockAccountsClient) ListKeys(arg0 context.Context, arg1, arg2 string, arg3 storage.ListKeyExpand) (storage.AccountListKeysResult, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ListKeys", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(storage.AccountListKeysResult)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ListKeys indicates an expected call of ListKeys
|
||||
func (mr *MockAccountsClientMockRecorder) ListKeys(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListKeys", reflect.TypeOf((*MockAccountsClient)(nil).ListKeys), arg0, arg1, arg2, arg3)
|
||||
}
|
Загрузка…
Ссылка в новой задаче