From f621f73f67d65f1dc2e392898c464ad7a4bfc021 Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Wed, 7 Oct 2020 15:21:31 -0700 Subject: [PATCH] :gem: Add Network Describer interface --- cloud/interfaces.go | 23 +- cloud/mocks/service_mock.go | 340 ++++++++++++++++-- cloud/scope/machine.go | 26 +- cloud/scope/machinepool.go | 8 +- .../mocks_bastionhosts/bastionhosts_mock.go | 188 +++++----- cloud/services/bastionhosts/service.go | 3 +- cloud/services/disks/disks_test.go | 8 +- cloud/services/disks/mock_disks/disks_mock.go | 98 ----- cloud/services/groups/service.go | 7 +- .../inboundnatrules_mock.go | 98 ----- .../mock_loadbalancers/loadbalancers_mock.go | 188 +++++----- cloud/services/loadbalancers/service.go | 3 +- .../networkinterfaces_mock.go | 286 +++++---------- .../networkinterfaces_test.go | 1 - cloud/services/networkinterfaces/service.go | 2 +- .../mock_publicips/publicips_mock.go | 98 ----- .../roleassignments_mock.go | 98 ----- .../mock_routetables/routetables_mock.go | 188 +++++----- cloud/services/routetables/service.go | 3 +- .../mock_scalesets/scalesets_mock.go | 286 +++++---------- cloud/services/scalesets/service.go | 2 +- cloud/services/scalesets/vmss_test.go | 2 +- .../securitygroups_mock.go | 188 +++++----- cloud/services/securitygroups/service.go | 3 +- .../subnets/mock_subnets/subnets_mock.go | 188 +++++----- cloud/services/subnets/service.go | 3 +- cloud/services/tags/mock_tags/tags_mock.go | 286 +++++---------- cloud/services/tags/service.go | 2 +- .../virtualmachines_mock.go | 286 +++++---------- cloud/services/virtualmachines/service.go | 2 +- cloud/services/virtualnetworks/service.go | 1 + controllers/azuremachine_controller.go | 10 +- controllers/azuremachine_controller_test.go | 8 +- controllers/helpers.go | 8 +- .../azuremachinepool_controller.go | 2 +- .../azuremachinepool_controller_unit_test.go | 6 +- 36 files changed, 1236 insertions(+), 1713 deletions(-) diff --git a/cloud/interfaces.go b/cloud/interfaces.go index 2e6b3417de8..72d23918f44 100644 --- a/cloud/interfaces.go +++ b/cloud/interfaces.go @@ -56,13 +56,8 @@ type Authorizer interface { Authorizer() autorest.Authorizer } -// ClusterDescriber is an interface which can get common Azure Cluster information -type ClusterDescriber interface { - Authorizer - ResourceGroup() string - ClusterName() string - Location() string - AdditionalTags() infrav1.Tags +// NetworkDescriber is an interface which can get common Azure Cluster Networking information. +type NetworkDescriber interface { Vnet() *infrav1.VnetSpec IsVnetManaged() bool NodeSubnet() *infrav1.SubnetSpec @@ -71,3 +66,17 @@ type ClusterDescriber interface { NodeRouteTable() *infrav1.RouteTable ControlPlaneRouteTable() *infrav1.RouteTable } + +// ClusterDescriber is an interface which can get common Azure Cluster information. +type ClusterDescriber interface { + Authorizer + ResourceGroup() string + ClusterName() string + Location() string + AdditionalTags() infrav1.Tags +} + +type ClusterScoper interface { + ClusterDescriber + NetworkDescriber +} diff --git a/cloud/mocks/service_mock.go b/cloud/mocks/service_mock.go index b3f92dd15a7..7f2ca2ba4a3 100644 --- a/cloud/mocks/service_mock.go +++ b/cloud/mocks/service_mock.go @@ -317,6 +317,127 @@ func (mr *MockAuthorizerMockRecorder) Authorizer() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authorizer", reflect.TypeOf((*MockAuthorizer)(nil).Authorizer)) } +// MockNetworkDescriber is a mock of NetworkDescriber interface. +type MockNetworkDescriber struct { + ctrl *gomock.Controller + recorder *MockNetworkDescriberMockRecorder +} + +// MockNetworkDescriberMockRecorder is the mock recorder for MockNetworkDescriber. +type MockNetworkDescriberMockRecorder struct { + mock *MockNetworkDescriber +} + +// NewMockNetworkDescriber creates a new mock instance. +func NewMockNetworkDescriber(ctrl *gomock.Controller) *MockNetworkDescriber { + mock := &MockNetworkDescriber{ctrl: ctrl} + mock.recorder = &MockNetworkDescriberMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockNetworkDescriber) EXPECT() *MockNetworkDescriberMockRecorder { + return m.recorder +} + +// Vnet mocks base method. +func (m *MockNetworkDescriber) Vnet() *v1alpha3.VnetSpec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Vnet") + ret0, _ := ret[0].(*v1alpha3.VnetSpec) + return ret0 +} + +// Vnet indicates an expected call of Vnet. +func (mr *MockNetworkDescriberMockRecorder) Vnet() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockNetworkDescriber)(nil).Vnet)) +} + +// IsVnetManaged mocks base method. +func (m *MockNetworkDescriber) IsVnetManaged() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsVnetManaged") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsVnetManaged indicates an expected call of IsVnetManaged. +func (mr *MockNetworkDescriberMockRecorder) IsVnetManaged() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockNetworkDescriber)(nil).IsVnetManaged)) +} + +// NodeSubnet mocks base method. +func (m *MockNetworkDescriber) NodeSubnet() *v1alpha3.SubnetSpec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NodeSubnet") + ret0, _ := ret[0].(*v1alpha3.SubnetSpec) + return ret0 +} + +// NodeSubnet indicates an expected call of NodeSubnet. +func (mr *MockNetworkDescriberMockRecorder) NodeSubnet() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockNetworkDescriber)(nil).NodeSubnet)) +} + +// ControlPlaneSubnet mocks base method. +func (m *MockNetworkDescriber) ControlPlaneSubnet() *v1alpha3.SubnetSpec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ControlPlaneSubnet") + ret0, _ := ret[0].(*v1alpha3.SubnetSpec) + return ret0 +} + +// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. +func (mr *MockNetworkDescriberMockRecorder) ControlPlaneSubnet() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockNetworkDescriber)(nil).ControlPlaneSubnet)) +} + +// IsIPv6Enabled mocks base method. +func (m *MockNetworkDescriber) IsIPv6Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsIPv6Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. +func (mr *MockNetworkDescriberMockRecorder) IsIPv6Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockNetworkDescriber)(nil).IsIPv6Enabled)) +} + +// NodeRouteTable mocks base method. +func (m *MockNetworkDescriber) NodeRouteTable() *v1alpha3.RouteTable { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NodeRouteTable") + ret0, _ := ret[0].(*v1alpha3.RouteTable) + return ret0 +} + +// NodeRouteTable indicates an expected call of NodeRouteTable. +func (mr *MockNetworkDescriberMockRecorder) NodeRouteTable() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockNetworkDescriber)(nil).NodeRouteTable)) +} + +// ControlPlaneRouteTable mocks base method. +func (m *MockNetworkDescriber) ControlPlaneRouteTable() *v1alpha3.RouteTable { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ControlPlaneRouteTable") + ret0, _ := ret[0].(*v1alpha3.RouteTable) + return ret0 +} + +// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. +func (mr *MockNetworkDescriberMockRecorder) ControlPlaneRouteTable() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockNetworkDescriber)(nil).ControlPlaneRouteTable)) +} + // MockClusterDescriber is a mock of ClusterDescriber interface. type MockClusterDescriber struct { ctrl *gomock.Controller @@ -494,8 +615,185 @@ func (mr *MockClusterDescriberMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockClusterDescriber)(nil).AdditionalTags)) } +// MockClusterScoper is a mock of ClusterScoper interface. +type MockClusterScoper struct { + ctrl *gomock.Controller + recorder *MockClusterScoperMockRecorder +} + +// MockClusterScoperMockRecorder is the mock recorder for MockClusterScoper. +type MockClusterScoperMockRecorder struct { + mock *MockClusterScoper +} + +// NewMockClusterScoper creates a new mock instance. +func NewMockClusterScoper(ctrl *gomock.Controller) *MockClusterScoper { + mock := &MockClusterScoper{ctrl: ctrl} + mock.recorder = &MockClusterScoperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClusterScoper) EXPECT() *MockClusterScoperMockRecorder { + return m.recorder +} + +// SubscriptionID mocks base method. +func (m *MockClusterScoper) SubscriptionID() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubscriptionID") + ret0, _ := ret[0].(string) + return ret0 +} + +// SubscriptionID indicates an expected call of SubscriptionID. +func (mr *MockClusterScoperMockRecorder) SubscriptionID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscriptionID", reflect.TypeOf((*MockClusterScoper)(nil).SubscriptionID)) +} + +// ClientID mocks base method. +func (m *MockClusterScoper) ClientID() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClientID") + ret0, _ := ret[0].(string) + return ret0 +} + +// ClientID indicates an expected call of ClientID. +func (mr *MockClusterScoperMockRecorder) ClientID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientID", reflect.TypeOf((*MockClusterScoper)(nil).ClientID)) +} + +// ClientSecret mocks base method. +func (m *MockClusterScoper) ClientSecret() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClientSecret") + ret0, _ := ret[0].(string) + return ret0 +} + +// ClientSecret indicates an expected call of ClientSecret. +func (mr *MockClusterScoperMockRecorder) ClientSecret() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientSecret", reflect.TypeOf((*MockClusterScoper)(nil).ClientSecret)) +} + +// CloudEnvironment mocks base method. +func (m *MockClusterScoper) CloudEnvironment() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CloudEnvironment") + ret0, _ := ret[0].(string) + return ret0 +} + +// CloudEnvironment indicates an expected call of CloudEnvironment. +func (mr *MockClusterScoperMockRecorder) CloudEnvironment() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloudEnvironment", reflect.TypeOf((*MockClusterScoper)(nil).CloudEnvironment)) +} + +// TenantID mocks base method. +func (m *MockClusterScoper) TenantID() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TenantID") + ret0, _ := ret[0].(string) + return ret0 +} + +// TenantID indicates an expected call of TenantID. +func (mr *MockClusterScoperMockRecorder) TenantID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TenantID", reflect.TypeOf((*MockClusterScoper)(nil).TenantID)) +} + +// BaseURI mocks base method. +func (m *MockClusterScoper) BaseURI() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BaseURI") + ret0, _ := ret[0].(string) + return ret0 +} + +// BaseURI indicates an expected call of BaseURI. +func (mr *MockClusterScoperMockRecorder) BaseURI() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BaseURI", reflect.TypeOf((*MockClusterScoper)(nil).BaseURI)) +} + +// Authorizer mocks base method. +func (m *MockClusterScoper) Authorizer() autorest.Authorizer { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Authorizer") + ret0, _ := ret[0].(autorest.Authorizer) + return ret0 +} + +// Authorizer indicates an expected call of Authorizer. +func (mr *MockClusterScoperMockRecorder) Authorizer() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authorizer", reflect.TypeOf((*MockClusterScoper)(nil).Authorizer)) +} + +// ResourceGroup mocks base method. +func (m *MockClusterScoper) ResourceGroup() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ResourceGroup") + ret0, _ := ret[0].(string) + return ret0 +} + +// ResourceGroup indicates an expected call of ResourceGroup. +func (mr *MockClusterScoperMockRecorder) ResourceGroup() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResourceGroup", reflect.TypeOf((*MockClusterScoper)(nil).ResourceGroup)) +} + +// ClusterName mocks base method. +func (m *MockClusterScoper) ClusterName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClusterName") + ret0, _ := ret[0].(string) + return ret0 +} + +// ClusterName indicates an expected call of ClusterName. +func (mr *MockClusterScoperMockRecorder) ClusterName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClusterName", reflect.TypeOf((*MockClusterScoper)(nil).ClusterName)) +} + +// Location mocks base method. +func (m *MockClusterScoper) Location() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Location") + ret0, _ := ret[0].(string) + return ret0 +} + +// Location indicates an expected call of Location. +func (mr *MockClusterScoperMockRecorder) Location() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Location", reflect.TypeOf((*MockClusterScoper)(nil).Location)) +} + +// AdditionalTags mocks base method. +func (m *MockClusterScoper) AdditionalTags() v1alpha3.Tags { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AdditionalTags") + ret0, _ := ret[0].(v1alpha3.Tags) + return ret0 +} + +// AdditionalTags indicates an expected call of AdditionalTags. +func (mr *MockClusterScoperMockRecorder) AdditionalTags() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockClusterScoper)(nil).AdditionalTags)) +} + // Vnet mocks base method. -func (m *MockClusterDescriber) Vnet() *v1alpha3.VnetSpec { +func (m *MockClusterScoper) Vnet() *v1alpha3.VnetSpec { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Vnet") ret0, _ := ret[0].(*v1alpha3.VnetSpec) @@ -503,13 +801,13 @@ func (m *MockClusterDescriber) Vnet() *v1alpha3.VnetSpec { } // Vnet indicates an expected call of Vnet. -func (mr *MockClusterDescriberMockRecorder) Vnet() *gomock.Call { +func (mr *MockClusterScoperMockRecorder) Vnet() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockClusterDescriber)(nil).Vnet)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockClusterScoper)(nil).Vnet)) } // IsVnetManaged mocks base method. -func (m *MockClusterDescriber) IsVnetManaged() bool { +func (m *MockClusterScoper) IsVnetManaged() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsVnetManaged") ret0, _ := ret[0].(bool) @@ -517,13 +815,13 @@ func (m *MockClusterDescriber) IsVnetManaged() bool { } // IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockClusterDescriberMockRecorder) IsVnetManaged() *gomock.Call { +func (mr *MockClusterScoperMockRecorder) IsVnetManaged() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockClusterDescriber)(nil).IsVnetManaged)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockClusterScoper)(nil).IsVnetManaged)) } // NodeSubnet mocks base method. -func (m *MockClusterDescriber) NodeSubnet() *v1alpha3.SubnetSpec { +func (m *MockClusterScoper) NodeSubnet() *v1alpha3.SubnetSpec { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NodeSubnet") ret0, _ := ret[0].(*v1alpha3.SubnetSpec) @@ -531,13 +829,13 @@ func (m *MockClusterDescriber) NodeSubnet() *v1alpha3.SubnetSpec { } // NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockClusterDescriberMockRecorder) NodeSubnet() *gomock.Call { +func (mr *MockClusterScoperMockRecorder) NodeSubnet() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockClusterDescriber)(nil).NodeSubnet)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockClusterScoper)(nil).NodeSubnet)) } // ControlPlaneSubnet mocks base method. -func (m *MockClusterDescriber) ControlPlaneSubnet() *v1alpha3.SubnetSpec { +func (m *MockClusterScoper) ControlPlaneSubnet() *v1alpha3.SubnetSpec { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ControlPlaneSubnet") ret0, _ := ret[0].(*v1alpha3.SubnetSpec) @@ -545,13 +843,13 @@ func (m *MockClusterDescriber) ControlPlaneSubnet() *v1alpha3.SubnetSpec { } // ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockClusterDescriberMockRecorder) ControlPlaneSubnet() *gomock.Call { +func (mr *MockClusterScoperMockRecorder) ControlPlaneSubnet() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockClusterDescriber)(nil).ControlPlaneSubnet)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockClusterScoper)(nil).ControlPlaneSubnet)) } // IsIPv6Enabled mocks base method. -func (m *MockClusterDescriber) IsIPv6Enabled() bool { +func (m *MockClusterScoper) IsIPv6Enabled() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsIPv6Enabled") ret0, _ := ret[0].(bool) @@ -559,13 +857,13 @@ func (m *MockClusterDescriber) IsIPv6Enabled() bool { } // IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockClusterDescriberMockRecorder) IsIPv6Enabled() *gomock.Call { +func (mr *MockClusterScoperMockRecorder) IsIPv6Enabled() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockClusterDescriber)(nil).IsIPv6Enabled)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockClusterScoper)(nil).IsIPv6Enabled)) } // NodeRouteTable mocks base method. -func (m *MockClusterDescriber) NodeRouteTable() *v1alpha3.RouteTable { +func (m *MockClusterScoper) NodeRouteTable() *v1alpha3.RouteTable { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NodeRouteTable") ret0, _ := ret[0].(*v1alpha3.RouteTable) @@ -573,13 +871,13 @@ func (m *MockClusterDescriber) NodeRouteTable() *v1alpha3.RouteTable { } // NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockClusterDescriberMockRecorder) NodeRouteTable() *gomock.Call { +func (mr *MockClusterScoperMockRecorder) NodeRouteTable() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockClusterDescriber)(nil).NodeRouteTable)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockClusterScoper)(nil).NodeRouteTable)) } // ControlPlaneRouteTable mocks base method. -func (m *MockClusterDescriber) ControlPlaneRouteTable() *v1alpha3.RouteTable { +func (m *MockClusterScoper) ControlPlaneRouteTable() *v1alpha3.RouteTable { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ControlPlaneRouteTable") ret0, _ := ret[0].(*v1alpha3.RouteTable) @@ -587,7 +885,7 @@ func (m *MockClusterDescriber) ControlPlaneRouteTable() *v1alpha3.RouteTable { } // ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockClusterDescriberMockRecorder) ControlPlaneRouteTable() *gomock.Call { +func (mr *MockClusterScoperMockRecorder) ControlPlaneRouteTable() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockClusterDescriber)(nil).ControlPlaneRouteTable)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockClusterScoper)(nil).ControlPlaneRouteTable)) } diff --git a/cloud/scope/machine.go b/cloud/scope/machine.go index 0c8de298241..123fee991c8 100644 --- a/cloud/scope/machine.go +++ b/cloud/scope/machine.go @@ -38,11 +38,11 @@ import ( // MachineScopeParams defines the input parameters used to create a new MachineScope. type MachineScopeParams struct { - Client client.Client - Logger logr.Logger - ClusterDescriber azure.ClusterDescriber - Machine *clusterv1.Machine - AzureMachine *infrav1.AzureMachine + Client client.Client + Logger logr.Logger + ClusterScope azure.ClusterScoper + Machine *clusterv1.Machine + AzureMachine *infrav1.AzureMachine } // NewMachineScope creates a new MachineScope from the supplied parameters. @@ -66,12 +66,12 @@ func NewMachineScope(params MachineScopeParams) (*MachineScope, error) { return nil, errors.Wrap(err, "failed to init patch helper") } return &MachineScope{ - client: params.Client, - Machine: params.Machine, - AzureMachine: params.AzureMachine, - Logger: params.Logger, - patchHelper: helper, - ClusterDescriber: params.ClusterDescriber, + client: params.Client, + Machine: params.Machine, + AzureMachine: params.AzureMachine, + Logger: params.Logger, + patchHelper: helper, + ClusterScoper: params.ClusterScope, }, nil } @@ -81,7 +81,7 @@ type MachineScope struct { client client.Client patchHelper *patch.Helper - azure.ClusterDescriber + azure.ClusterScoper Machine *clusterv1.Machine AzureMachine *infrav1.AzureMachine } @@ -400,7 +400,7 @@ func (m *MachineScope) Close(ctx context.Context) error { func (m *MachineScope) AdditionalTags() infrav1.Tags { tags := make(infrav1.Tags) // Start with the cluster-wide tags... - tags.Merge(m.ClusterDescriber.AdditionalTags()) + tags.Merge(m.ClusterScoper.AdditionalTags()) // ... and merge in the Machine's tags.Merge(m.AzureMachine.Spec.AdditionalTags) // Set the cloud provider tag diff --git a/cloud/scope/machinepool.go b/cloud/scope/machinepool.go index c47d30b745a..89bc1181bff 100644 --- a/cloud/scope/machinepool.go +++ b/cloud/scope/machinepool.go @@ -45,7 +45,7 @@ type ( Logger logr.Logger MachinePool *capiv1exp.MachinePool AzureMachinePool *infrav1exp.AzureMachinePool - ClusterDescriber azure.ClusterDescriber + ClusterScope azure.ClusterScoper } // MachinePoolScope defines a scope defined around a machine pool and its cluster. @@ -55,7 +55,7 @@ type ( patchHelper *patch.Helper MachinePool *capiv1exp.MachinePool AzureMachinePool *infrav1exp.AzureMachinePool - azure.ClusterDescriber + azure.ClusterScoper } ) @@ -86,7 +86,7 @@ func NewMachinePoolScope(params MachinePoolScopeParams) (*MachinePoolScope, erro AzureMachinePool: params.AzureMachinePool, Logger: params.Logger, patchHelper: helper, - ClusterDescriber: params.ClusterDescriber, + ClusterScoper: params.ClusterScope, }, nil } @@ -165,7 +165,7 @@ func (m *MachinePoolScope) SetFailureReason(v capierrors.MachineStatusError) { func (m *MachinePoolScope) AdditionalTags() infrav1.Tags { tags := make(infrav1.Tags) // Start with the cluster-wide tags... - tags.Merge(m.ClusterDescriber.AdditionalTags()) + tags.Merge(m.ClusterScoper.AdditionalTags()) // ... and merge in the Machine Pool's tags.Merge(m.AzureMachinePool.Spec.AdditionalTags) // Set the cloud provider tag diff --git a/cloud/services/bastionhosts/mocks_bastionhosts/bastionhosts_mock.go b/cloud/services/bastionhosts/mocks_bastionhosts/bastionhosts_mock.go index 3007d7538fd..bca86fd08cc 100644 --- a/cloud/services/bastionhosts/mocks_bastionhosts/bastionhosts_mock.go +++ b/cloud/services/bastionhosts/mocks_bastionhosts/bastionhosts_mock.go @@ -52,6 +52,100 @@ func (m *MockBastionScope) EXPECT() *MockBastionScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockBastionScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockBastionScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockBastionScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockBastionScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockBastionScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockBastionScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockBastionScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockBastionScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockBastionScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockBastionScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockBastionScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockBastionScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockBastionScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockBastionScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockBastionScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockBastionScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockBastionScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockBastionScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockBastionScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -304,100 +398,6 @@ func (mr *MockBastionScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockBastionScope)(nil).ControlPlaneRouteTable)) } -// Info mocks base method. -func (m *MockBastionScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockBastionScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockBastionScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockBastionScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockBastionScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockBastionScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockBastionScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockBastionScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockBastionScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockBastionScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockBastionScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockBastionScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockBastionScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockBastionScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockBastionScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockBastionScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockBastionScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockBastionScope)(nil).WithName), name) -} - // BastionSpecs mocks base method. func (m *MockBastionScope) BastionSpecs() []azure.BastionSpec { m.ctrl.T.Helper() diff --git a/cloud/services/bastionhosts/service.go b/cloud/services/bastionhosts/service.go index 926e062d932..dd2e0d81bd9 100644 --- a/cloud/services/bastionhosts/service.go +++ b/cloud/services/bastionhosts/service.go @@ -25,8 +25,9 @@ import ( // BastionScope defines the scope interface for a bastion host service. type BastionScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber + azure.NetworkDescriber BastionSpecs() []azure.BastionSpec } diff --git a/cloud/services/disks/disks_test.go b/cloud/services/disks/disks_test.go index 0c9d65bfd7e..d5b10043467 100644 --- a/cloud/services/disks/disks_test.go +++ b/cloud/services/disks/disks_test.go @@ -248,10 +248,10 @@ func TestDiskSpecs(t *testing.T) { }) g.Expect(err).NotTo(HaveOccurred()) machineScope, err := scope.NewMachineScope(scope.MachineScopeParams{ - Client: client, - ClusterDescriber: clusterScope, - Machine: machine, - AzureMachine: tc.azureMachine, + Client: client, + ClusterScope: clusterScope, + Machine: machine, + AzureMachine: tc.azureMachine, }) g.Expect(err).NotTo(HaveOccurred()) diff --git a/cloud/services/disks/mock_disks/disks_mock.go b/cloud/services/disks/mock_disks/disks_mock.go index 8bb46474f2d..68da53775e9 100644 --- a/cloud/services/disks/mock_disks/disks_mock.go +++ b/cloud/services/disks/mock_disks/disks_mock.go @@ -300,104 +300,6 @@ func (mr *MockDiskScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockDiskScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockDiskScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockDiskScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockDiskScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockDiskScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockDiskScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockDiskScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockDiskScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockDiskScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockDiskScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockDiskScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockDiskScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockDiskScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockDiskScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockDiskScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockDiskScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockDiskScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockDiskScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockDiskScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockDiskScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockDiskScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockDiskScope)(nil).ControlPlaneRouteTable)) -} - // DiskSpecs mocks base method. func (m *MockDiskScope) DiskSpecs() []azure.DiskSpec { m.ctrl.T.Helper() diff --git a/cloud/services/groups/service.go b/cloud/services/groups/service.go index 468f936b5d4..e57cd7d92c9 100644 --- a/cloud/services/groups/service.go +++ b/cloud/services/groups/service.go @@ -18,7 +18,6 @@ package groups import ( "github.com/go-logr/logr" - infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3" azure "sigs.k8s.io/cluster-api-provider-azure/cloud" ) @@ -31,11 +30,7 @@ type Service struct { // GroupScope defines the scope interface for a group service. type GroupScope interface { logr.Logger - azure.Authorizer - ResourceGroup() string - ClusterName() string - Location() string - AdditionalTags() infrav1.Tags + azure.ClusterDescriber } // NewService creates a new service. diff --git a/cloud/services/inboundnatrules/mock_inboundnatrules/inboundnatrules_mock.go b/cloud/services/inboundnatrules/mock_inboundnatrules/inboundnatrules_mock.go index 885afcc6c80..76e91daead9 100644 --- a/cloud/services/inboundnatrules/mock_inboundnatrules/inboundnatrules_mock.go +++ b/cloud/services/inboundnatrules/mock_inboundnatrules/inboundnatrules_mock.go @@ -300,104 +300,6 @@ func (mr *MockInboundNatScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockInboundNatScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockInboundNatScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockInboundNatScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockInboundNatScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockInboundNatScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockInboundNatScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockInboundNatScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockInboundNatScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockInboundNatScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockInboundNatScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockInboundNatScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockInboundNatScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockInboundNatScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockInboundNatScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockInboundNatScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockInboundNatScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockInboundNatScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockInboundNatScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockInboundNatScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockInboundNatScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockInboundNatScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockInboundNatScope)(nil).ControlPlaneRouteTable)) -} - // InboundNatSpecs mocks base method. func (m *MockInboundNatScope) InboundNatSpecs() []azure.InboundNatSpec { m.ctrl.T.Helper() diff --git a/cloud/services/loadbalancers/mock_loadbalancers/loadbalancers_mock.go b/cloud/services/loadbalancers/mock_loadbalancers/loadbalancers_mock.go index e191b52f848..c0657266def 100644 --- a/cloud/services/loadbalancers/mock_loadbalancers/loadbalancers_mock.go +++ b/cloud/services/loadbalancers/mock_loadbalancers/loadbalancers_mock.go @@ -52,6 +52,100 @@ func (m *MockLBScope) EXPECT() *MockLBScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockLBScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockLBScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLBScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockLBScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockLBScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockLBScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockLBScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockLBScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLBScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockLBScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockLBScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockLBScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockLBScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockLBScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockLBScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockLBScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockLBScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockLBScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockLBScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -304,100 +398,6 @@ func (mr *MockLBScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockLBScope)(nil).ControlPlaneRouteTable)) } -// Info mocks base method. -func (m *MockLBScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockLBScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLBScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockLBScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockLBScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockLBScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockLBScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockLBScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLBScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockLBScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockLBScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockLBScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockLBScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockLBScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockLBScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockLBScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockLBScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockLBScope)(nil).WithName), name) -} - // LBSpecs mocks base method. func (m *MockLBScope) LBSpecs() []azure.LBSpec { m.ctrl.T.Helper() diff --git a/cloud/services/loadbalancers/service.go b/cloud/services/loadbalancers/service.go index f8ff6a96b59..9a57ee69ae4 100644 --- a/cloud/services/loadbalancers/service.go +++ b/cloud/services/loadbalancers/service.go @@ -24,8 +24,9 @@ import ( // LBScope defines the scope interface for a load balancer service. type LBScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber + azure.NetworkDescriber LBSpecs() []azure.LBSpec } diff --git a/cloud/services/networkinterfaces/mock_networkinterfaces/networkinterfaces_mock.go b/cloud/services/networkinterfaces/mock_networkinterfaces/networkinterfaces_mock.go index d93aa183492..777b857553a 100644 --- a/cloud/services/networkinterfaces/mock_networkinterfaces/networkinterfaces_mock.go +++ b/cloud/services/networkinterfaces/mock_networkinterfaces/networkinterfaces_mock.go @@ -52,6 +52,100 @@ func (m *MockNICScope) EXPECT() *MockNICScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockNICScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockNICScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockNICScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockNICScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockNICScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockNICScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockNICScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockNICScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockNICScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockNICScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockNICScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockNICScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockNICScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockNICScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockNICScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockNICScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockNICScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockNICScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockNICScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -206,198 +300,6 @@ func (mr *MockNICScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockNICScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockNICScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockNICScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockNICScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockNICScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockNICScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockNICScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockNICScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockNICScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockNICScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockNICScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockNICScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockNICScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockNICScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockNICScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockNICScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockNICScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockNICScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockNICScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockNICScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockNICScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockNICScope)(nil).ControlPlaneRouteTable)) -} - -// Info mocks base method. -func (m *MockNICScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockNICScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockNICScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockNICScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockNICScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockNICScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockNICScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockNICScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockNICScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockNICScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockNICScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockNICScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockNICScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockNICScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockNICScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockNICScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockNICScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockNICScope)(nil).WithName), name) -} - // NICSpecs mocks base method. func (m *MockNICScope) NICSpecs() []azure.NICSpec { m.ctrl.T.Helper() diff --git a/cloud/services/networkinterfaces/networkinterfaces_test.go b/cloud/services/networkinterfaces/networkinterfaces_test.go index 22c2747be3a..8f6a5950370 100644 --- a/cloud/services/networkinterfaces/networkinterfaces_test.go +++ b/cloud/services/networkinterfaces/networkinterfaces_test.go @@ -366,7 +366,6 @@ func TestReconcileNetworkInterface(t *testing.T) { s.ResourceGroup().AnyTimes().Return("my-rg") s.Location().AnyTimes().Return("fake-location") s.V(gomock.AssignableToTypeOf(2)).AnyTimes().Return(klogr.New()) - s.IsIPv6Enabled().AnyTimes().Return(true) gomock.InOrder( m.Get(context.TODO(), "my-rg", "my-net-interface"). Return(network.Interface{}, autorest.NewErrorWithResponse("", "", &http.Response{StatusCode: 404}, "Not found")), diff --git a/cloud/services/networkinterfaces/service.go b/cloud/services/networkinterfaces/service.go index 4c8878a384e..3c73c56779e 100644 --- a/cloud/services/networkinterfaces/service.go +++ b/cloud/services/networkinterfaces/service.go @@ -24,8 +24,8 @@ import ( // NICScope defines the scope interface for a network interfaces service. type NICScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber NICSpecs() []azure.NICSpec } diff --git a/cloud/services/publicips/mock_publicips/publicips_mock.go b/cloud/services/publicips/mock_publicips/publicips_mock.go index 2148685b1c3..43a26d8d02b 100644 --- a/cloud/services/publicips/mock_publicips/publicips_mock.go +++ b/cloud/services/publicips/mock_publicips/publicips_mock.go @@ -300,104 +300,6 @@ func (mr *MockPublicIPScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockPublicIPScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockPublicIPScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockPublicIPScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockPublicIPScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockPublicIPScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockPublicIPScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockPublicIPScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockPublicIPScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockPublicIPScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockPublicIPScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockPublicIPScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockPublicIPScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockPublicIPScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockPublicIPScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockPublicIPScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockPublicIPScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockPublicIPScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockPublicIPScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockPublicIPScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockPublicIPScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockPublicIPScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockPublicIPScope)(nil).ControlPlaneRouteTable)) -} - // PublicIPSpecs mocks base method. func (m *MockPublicIPScope) PublicIPSpecs() []azure.PublicIPSpec { m.ctrl.T.Helper() diff --git a/cloud/services/roleassignments/mock_roleassignments/roleassignments_mock.go b/cloud/services/roleassignments/mock_roleassignments/roleassignments_mock.go index 87c82429132..f2fb10506b2 100644 --- a/cloud/services/roleassignments/mock_roleassignments/roleassignments_mock.go +++ b/cloud/services/roleassignments/mock_roleassignments/roleassignments_mock.go @@ -300,104 +300,6 @@ func (mr *MockRoleAssignmentScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockRoleAssignmentScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockRoleAssignmentScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockRoleAssignmentScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockRoleAssignmentScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockRoleAssignmentScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockRoleAssignmentScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockRoleAssignmentScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockRoleAssignmentScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockRoleAssignmentScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockRoleAssignmentScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockRoleAssignmentScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockRoleAssignmentScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockRoleAssignmentScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockRoleAssignmentScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockRoleAssignmentScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockRoleAssignmentScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockRoleAssignmentScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockRoleAssignmentScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockRoleAssignmentScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockRoleAssignmentScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockRoleAssignmentScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockRoleAssignmentScope)(nil).ControlPlaneRouteTable)) -} - // RoleAssignmentSpecs mocks base method. func (m *MockRoleAssignmentScope) RoleAssignmentSpecs() []azure.RoleAssignmentSpec { m.ctrl.T.Helper() diff --git a/cloud/services/routetables/mock_routetables/routetables_mock.go b/cloud/services/routetables/mock_routetables/routetables_mock.go index 74bf7f44742..74b80d039f6 100644 --- a/cloud/services/routetables/mock_routetables/routetables_mock.go +++ b/cloud/services/routetables/mock_routetables/routetables_mock.go @@ -52,6 +52,100 @@ func (m *MockRouteTableScope) EXPECT() *MockRouteTableScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockRouteTableScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockRouteTableScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockRouteTableScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockRouteTableScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockRouteTableScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockRouteTableScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockRouteTableScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockRouteTableScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockRouteTableScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockRouteTableScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockRouteTableScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockRouteTableScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockRouteTableScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockRouteTableScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockRouteTableScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockRouteTableScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockRouteTableScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockRouteTableScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockRouteTableScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -304,100 +398,6 @@ func (mr *MockRouteTableScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockRouteTableScope)(nil).ControlPlaneRouteTable)) } -// Info mocks base method. -func (m *MockRouteTableScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockRouteTableScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockRouteTableScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockRouteTableScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockRouteTableScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockRouteTableScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockRouteTableScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockRouteTableScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockRouteTableScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockRouteTableScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockRouteTableScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockRouteTableScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockRouteTableScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockRouteTableScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockRouteTableScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockRouteTableScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockRouteTableScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockRouteTableScope)(nil).WithName), name) -} - // RouteTableSpecs mocks base method. func (m *MockRouteTableScope) RouteTableSpecs() []azure.RouteTableSpec { m.ctrl.T.Helper() diff --git a/cloud/services/routetables/service.go b/cloud/services/routetables/service.go index 6fa90327874..54f02f8a102 100644 --- a/cloud/services/routetables/service.go +++ b/cloud/services/routetables/service.go @@ -24,8 +24,9 @@ import ( // RouteTableScope defines the scope interface for route table service type RouteTableScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber + azure.NetworkDescriber RouteTableSpecs() []azure.RouteTableSpec } diff --git a/cloud/services/scalesets/mock_scalesets/scalesets_mock.go b/cloud/services/scalesets/mock_scalesets/scalesets_mock.go index 3c6d280c409..eb2ea83bb8b 100644 --- a/cloud/services/scalesets/mock_scalesets/scalesets_mock.go +++ b/cloud/services/scalesets/mock_scalesets/scalesets_mock.go @@ -53,6 +53,100 @@ func (m *MockScaleSetScope) EXPECT() *MockScaleSetScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockScaleSetScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockScaleSetScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockScaleSetScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockScaleSetScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockScaleSetScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockScaleSetScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockScaleSetScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockScaleSetScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockScaleSetScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockScaleSetScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockScaleSetScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockScaleSetScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockScaleSetScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockScaleSetScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockScaleSetScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockScaleSetScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockScaleSetScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockScaleSetScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockScaleSetScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -207,198 +301,6 @@ func (mr *MockScaleSetScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockScaleSetScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockScaleSetScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockScaleSetScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockScaleSetScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockScaleSetScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockScaleSetScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockScaleSetScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockScaleSetScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockScaleSetScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockScaleSetScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockScaleSetScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockScaleSetScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockScaleSetScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockScaleSetScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockScaleSetScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockScaleSetScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockScaleSetScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockScaleSetScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockScaleSetScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockScaleSetScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockScaleSetScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockScaleSetScope)(nil).ControlPlaneRouteTable)) -} - -// Info mocks base method. -func (m *MockScaleSetScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockScaleSetScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockScaleSetScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockScaleSetScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockScaleSetScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockScaleSetScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockScaleSetScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockScaleSetScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockScaleSetScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockScaleSetScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockScaleSetScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockScaleSetScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockScaleSetScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockScaleSetScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockScaleSetScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockScaleSetScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockScaleSetScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockScaleSetScope)(nil).WithName), name) -} - // ScaleSetSpec mocks base method. func (m *MockScaleSetScope) ScaleSetSpec() azure.ScaleSetSpec { m.ctrl.T.Helper() diff --git a/cloud/services/scalesets/service.go b/cloud/services/scalesets/service.go index 8eef704a07d..e510dfef45d 100644 --- a/cloud/services/scalesets/service.go +++ b/cloud/services/scalesets/service.go @@ -25,8 +25,8 @@ import ( // ScaleSetScope defines the scope interface for a scale sets service. type ScaleSetScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber ScaleSetSpec() azure.ScaleSetSpec GetBootstrapData(ctx context.Context) (string, error) GetVMImage() (*infrav1.Image, error) diff --git a/cloud/services/scalesets/vmss_test.go b/cloud/services/scalesets/vmss_test.go index 41c1661be1e..470cd3f1e8d 100644 --- a/cloud/services/scalesets/vmss_test.go +++ b/cloud/services/scalesets/vmss_test.go @@ -79,7 +79,7 @@ func TestNewService(t *testing.T) { Logger: s.Logger, MachinePool: new(clusterv1exp.MachinePool), AzureMachinePool: new(infrav1exp.AzureMachinePool), - ClusterDescriber: s, + ClusterScope: s, }) g.Expect(err).ToNot(gomega.HaveOccurred()) actual := NewService(mps, resourceskus.NewStaticCache(nil)) diff --git a/cloud/services/securitygroups/mock_securitygroups/securitygroups_mock.go b/cloud/services/securitygroups/mock_securitygroups/securitygroups_mock.go index c7f1ef1a51e..868784faecb 100644 --- a/cloud/services/securitygroups/mock_securitygroups/securitygroups_mock.go +++ b/cloud/services/securitygroups/mock_securitygroups/securitygroups_mock.go @@ -52,6 +52,100 @@ func (m *MockNSGScope) EXPECT() *MockNSGScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockNSGScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockNSGScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockNSGScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockNSGScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockNSGScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockNSGScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockNSGScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockNSGScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockNSGScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockNSGScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockNSGScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockNSGScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockNSGScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockNSGScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockNSGScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockNSGScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockNSGScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockNSGScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockNSGScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -304,100 +398,6 @@ func (mr *MockNSGScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockNSGScope)(nil).ControlPlaneRouteTable)) } -// Info mocks base method. -func (m *MockNSGScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockNSGScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockNSGScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockNSGScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockNSGScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockNSGScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockNSGScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockNSGScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockNSGScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockNSGScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockNSGScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockNSGScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockNSGScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockNSGScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockNSGScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockNSGScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockNSGScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockNSGScope)(nil).WithName), name) -} - // NSGSpecs mocks base method. func (m *MockNSGScope) NSGSpecs() []azure.NSGSpec { m.ctrl.T.Helper() diff --git a/cloud/services/securitygroups/service.go b/cloud/services/securitygroups/service.go index 48266f5de19..723d67e76e9 100644 --- a/cloud/services/securitygroups/service.go +++ b/cloud/services/securitygroups/service.go @@ -23,8 +23,9 @@ import ( // NSGScope defines the scope interface for a security groups service. type NSGScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber + azure.NetworkDescriber NSGSpecs() []azure.NSGSpec } diff --git a/cloud/services/subnets/mock_subnets/subnets_mock.go b/cloud/services/subnets/mock_subnets/subnets_mock.go index 426e62d0ac0..e5f6a208978 100644 --- a/cloud/services/subnets/mock_subnets/subnets_mock.go +++ b/cloud/services/subnets/mock_subnets/subnets_mock.go @@ -52,6 +52,100 @@ func (m *MockSubnetScope) EXPECT() *MockSubnetScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockSubnetScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockSubnetScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockSubnetScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockSubnetScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockSubnetScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockSubnetScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockSubnetScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockSubnetScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockSubnetScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockSubnetScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockSubnetScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockSubnetScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockSubnetScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockSubnetScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockSubnetScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockSubnetScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockSubnetScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockSubnetScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockSubnetScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -304,100 +398,6 @@ func (mr *MockSubnetScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockSubnetScope)(nil).ControlPlaneRouteTable)) } -// Info mocks base method. -func (m *MockSubnetScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockSubnetScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockSubnetScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockSubnetScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockSubnetScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockSubnetScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockSubnetScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockSubnetScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockSubnetScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockSubnetScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockSubnetScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockSubnetScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockSubnetScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockSubnetScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockSubnetScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockSubnetScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockSubnetScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockSubnetScope)(nil).WithName), name) -} - // SubnetSpecs mocks base method. func (m *MockSubnetScope) SubnetSpecs() []azure.SubnetSpec { m.ctrl.T.Helper() diff --git a/cloud/services/subnets/service.go b/cloud/services/subnets/service.go index f13075eb2f1..076cac86650 100644 --- a/cloud/services/subnets/service.go +++ b/cloud/services/subnets/service.go @@ -23,8 +23,9 @@ import ( // SubnetScope defines the scope interface for a subnet service. type SubnetScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber + azure.NetworkDescriber SubnetSpecs() []azure.SubnetSpec } diff --git a/cloud/services/tags/mock_tags/tags_mock.go b/cloud/services/tags/mock_tags/tags_mock.go index 24ce2c32107..2d1e35cf7da 100644 --- a/cloud/services/tags/mock_tags/tags_mock.go +++ b/cloud/services/tags/mock_tags/tags_mock.go @@ -52,6 +52,100 @@ func (m *MockTagScope) EXPECT() *MockTagScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockTagScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockTagScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockTagScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockTagScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockTagScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockTagScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockTagScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockTagScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockTagScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockTagScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockTagScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockTagScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockTagScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockTagScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockTagScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockTagScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockTagScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockTagScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockTagScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -206,198 +300,6 @@ func (mr *MockTagScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockTagScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockTagScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockTagScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockTagScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockTagScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockTagScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockTagScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockTagScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockTagScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockTagScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockTagScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockTagScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockTagScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockTagScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockTagScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockTagScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockTagScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockTagScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockTagScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockTagScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockTagScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockTagScope)(nil).ControlPlaneRouteTable)) -} - -// Info mocks base method. -func (m *MockTagScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockTagScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockTagScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockTagScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockTagScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockTagScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockTagScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockTagScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockTagScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockTagScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockTagScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockTagScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockTagScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockTagScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockTagScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockTagScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockTagScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockTagScope)(nil).WithName), name) -} - // TagsSpecs mocks base method. func (m *MockTagScope) TagsSpecs() []azure.TagsSpec { m.ctrl.T.Helper() diff --git a/cloud/services/tags/service.go b/cloud/services/tags/service.go index 5bf9832e870..3303788fab4 100644 --- a/cloud/services/tags/service.go +++ b/cloud/services/tags/service.go @@ -23,8 +23,8 @@ import ( // TagScope defines the scope interface for a tags service. type TagScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber TagsSpecs() []azure.TagsSpec AnnotationJSON(string) (map[string]interface{}, error) UpdateAnnotationJSON(string, map[string]interface{}) error diff --git a/cloud/services/virtualmachines/mock_virtualmachines/virtualmachines_mock.go b/cloud/services/virtualmachines/mock_virtualmachines/virtualmachines_mock.go index 77399690245..634db755f4c 100644 --- a/cloud/services/virtualmachines/mock_virtualmachines/virtualmachines_mock.go +++ b/cloud/services/virtualmachines/mock_virtualmachines/virtualmachines_mock.go @@ -54,6 +54,100 @@ func (m *MockVMScope) EXPECT() *MockVMScopeMockRecorder { return m.recorder } +// Info mocks base method. +func (m *MockVMScope) Info(msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Info", varargs...) +} + +// Info indicates an expected call of Info. +func (mr *MockVMScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockVMScope)(nil).Info), varargs...) +} + +// Enabled mocks base method. +func (m *MockVMScope) Enabled() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enabled") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Enabled indicates an expected call of Enabled. +func (mr *MockVMScopeMockRecorder) Enabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockVMScope)(nil).Enabled)) +} + +// Error mocks base method. +func (m *MockVMScope) Error(err error, msg string, keysAndValues ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{err, msg} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Error", varargs...) +} + +// Error indicates an expected call of Error. +func (mr *MockVMScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{err, msg}, keysAndValues...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockVMScope)(nil).Error), varargs...) +} + +// V mocks base method. +func (m *MockVMScope) V(level int) logr.InfoLogger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "V", level) + ret0, _ := ret[0].(logr.InfoLogger) + return ret0 +} + +// V indicates an expected call of V. +func (mr *MockVMScopeMockRecorder) V(level interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockVMScope)(nil).V), level) +} + +// WithValues mocks base method. +func (m *MockVMScope) WithValues(keysAndValues ...interface{}) logr.Logger { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range keysAndValues { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "WithValues", varargs...) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithValues indicates an expected call of WithValues. +func (mr *MockVMScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockVMScope)(nil).WithValues), keysAndValues...) +} + +// WithName mocks base method. +func (m *MockVMScope) WithName(name string) logr.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithName", name) + ret0, _ := ret[0].(logr.Logger) + return ret0 +} + +// WithName indicates an expected call of WithName. +func (mr *MockVMScopeMockRecorder) WithName(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockVMScope)(nil).WithName), name) +} + // SubscriptionID mocks base method. func (m *MockVMScope) SubscriptionID() string { m.ctrl.T.Helper() @@ -208,198 +302,6 @@ func (mr *MockVMScopeMockRecorder) AdditionalTags() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdditionalTags", reflect.TypeOf((*MockVMScope)(nil).AdditionalTags)) } -// Vnet mocks base method. -func (m *MockVMScope) Vnet() *v1alpha3.VnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Vnet") - ret0, _ := ret[0].(*v1alpha3.VnetSpec) - return ret0 -} - -// Vnet indicates an expected call of Vnet. -func (mr *MockVMScopeMockRecorder) Vnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Vnet", reflect.TypeOf((*MockVMScope)(nil).Vnet)) -} - -// IsVnetManaged mocks base method. -func (m *MockVMScope) IsVnetManaged() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsVnetManaged") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsVnetManaged indicates an expected call of IsVnetManaged. -func (mr *MockVMScopeMockRecorder) IsVnetManaged() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsVnetManaged", reflect.TypeOf((*MockVMScope)(nil).IsVnetManaged)) -} - -// NodeSubnet mocks base method. -func (m *MockVMScope) NodeSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// NodeSubnet indicates an expected call of NodeSubnet. -func (mr *MockVMScopeMockRecorder) NodeSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeSubnet", reflect.TypeOf((*MockVMScope)(nil).NodeSubnet)) -} - -// ControlPlaneSubnet mocks base method. -func (m *MockVMScope) ControlPlaneSubnet() *v1alpha3.SubnetSpec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneSubnet") - ret0, _ := ret[0].(*v1alpha3.SubnetSpec) - return ret0 -} - -// ControlPlaneSubnet indicates an expected call of ControlPlaneSubnet. -func (mr *MockVMScopeMockRecorder) ControlPlaneSubnet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneSubnet", reflect.TypeOf((*MockVMScope)(nil).ControlPlaneSubnet)) -} - -// IsIPv6Enabled mocks base method. -func (m *MockVMScope) IsIPv6Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsIPv6Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsIPv6Enabled indicates an expected call of IsIPv6Enabled. -func (mr *MockVMScopeMockRecorder) IsIPv6Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIPv6Enabled", reflect.TypeOf((*MockVMScope)(nil).IsIPv6Enabled)) -} - -// NodeRouteTable mocks base method. -func (m *MockVMScope) NodeRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// NodeRouteTable indicates an expected call of NodeRouteTable. -func (mr *MockVMScopeMockRecorder) NodeRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRouteTable", reflect.TypeOf((*MockVMScope)(nil).NodeRouteTable)) -} - -// ControlPlaneRouteTable mocks base method. -func (m *MockVMScope) ControlPlaneRouteTable() *v1alpha3.RouteTable { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ControlPlaneRouteTable") - ret0, _ := ret[0].(*v1alpha3.RouteTable) - return ret0 -} - -// ControlPlaneRouteTable indicates an expected call of ControlPlaneRouteTable. -func (mr *MockVMScopeMockRecorder) ControlPlaneRouteTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlPlaneRouteTable", reflect.TypeOf((*MockVMScope)(nil).ControlPlaneRouteTable)) -} - -// Info mocks base method. -func (m *MockVMScope) Info(msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockVMScopeMockRecorder) Info(msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockVMScope)(nil).Info), varargs...) -} - -// Enabled mocks base method. -func (m *MockVMScope) Enabled() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Enabled") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Enabled indicates an expected call of Enabled. -func (mr *MockVMScopeMockRecorder) Enabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enabled", reflect.TypeOf((*MockVMScope)(nil).Enabled)) -} - -// Error mocks base method. -func (m *MockVMScope) Error(err error, msg string, keysAndValues ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{err, msg} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockVMScopeMockRecorder) Error(err, msg interface{}, keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{err, msg}, keysAndValues...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockVMScope)(nil).Error), varargs...) -} - -// V mocks base method. -func (m *MockVMScope) V(level int) logr.InfoLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "V", level) - ret0, _ := ret[0].(logr.InfoLogger) - return ret0 -} - -// V indicates an expected call of V. -func (mr *MockVMScopeMockRecorder) V(level interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "V", reflect.TypeOf((*MockVMScope)(nil).V), level) -} - -// WithValues mocks base method. -func (m *MockVMScope) WithValues(keysAndValues ...interface{}) logr.Logger { - m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range keysAndValues { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "WithValues", varargs...) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithValues indicates an expected call of WithValues. -func (mr *MockVMScopeMockRecorder) WithValues(keysAndValues ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithValues", reflect.TypeOf((*MockVMScope)(nil).WithValues), keysAndValues...) -} - -// WithName mocks base method. -func (m *MockVMScope) WithName(name string) logr.Logger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithName", name) - ret0, _ := ret[0].(logr.Logger) - return ret0 -} - -// WithName indicates an expected call of WithName. -func (mr *MockVMScopeMockRecorder) WithName(name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithName", reflect.TypeOf((*MockVMScope)(nil).WithName), name) -} - // VMSpecs mocks base method. func (m *MockVMScope) VMSpecs() []azure.VMSpec { m.ctrl.T.Helper() diff --git a/cloud/services/virtualmachines/service.go b/cloud/services/virtualmachines/service.go index 6c975a38e15..fd5f7d27554 100644 --- a/cloud/services/virtualmachines/service.go +++ b/cloud/services/virtualmachines/service.go @@ -29,8 +29,8 @@ import ( // VMScope defines the scope interface for a virtual machines service. type VMScope interface { - azure.ClusterDescriber logr.Logger + azure.ClusterDescriber VMSpecs() []azure.VMSpec GetBootstrapData(ctx context.Context) (string, error) GetVMImage() (*infrav1.Image, error) diff --git a/cloud/services/virtualnetworks/service.go b/cloud/services/virtualnetworks/service.go index 68528ce46f1..676e60c9515 100644 --- a/cloud/services/virtualnetworks/service.go +++ b/cloud/services/virtualnetworks/service.go @@ -25,6 +25,7 @@ import ( type VNetScope interface { logr.Logger azure.ClusterDescriber + azure.NetworkDescriber VNetSpecs() []azure.VNetSpec } diff --git a/controllers/azuremachine_controller.go b/controllers/azuremachine_controller.go index 367cec24584..e6a0879bbe5 100644 --- a/controllers/azuremachine_controller.go +++ b/controllers/azuremachine_controller.go @@ -179,11 +179,11 @@ func (r *AzureMachineReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, ret // Create the machine scope machineScope, err := scope.NewMachineScope(scope.MachineScopeParams{ - Logger: logger, - Client: r.Client, - Machine: machine, - AzureMachine: azureMachine, - ClusterDescriber: clusterScope, + Logger: logger, + Client: r.Client, + Machine: machine, + AzureMachine: azureMachine, + ClusterScope: clusterScope, }) if err != nil { r.Recorder.Eventf(azureMachine, corev1.EventTypeWarning, "Error creating the machine scope", err.Error()) diff --git a/controllers/azuremachine_controller_test.go b/controllers/azuremachine_controller_test.go index dcfa434689f..2a1d7eb9ac5 100644 --- a/controllers/azuremachine_controller_test.go +++ b/controllers/azuremachine_controller_test.go @@ -177,10 +177,10 @@ func TestConditions(t *testing.T) { g.Expect(err).NotTo(HaveOccurred()) machineScope, err := scope.NewMachineScope(scope.MachineScopeParams{ - Client: client, - ClusterDescriber: clusterScope, - Machine: tc.machine, - AzureMachine: tc.azureMachine, + Client: client, + ClusterScope: clusterScope, + Machine: tc.machine, + AzureMachine: tc.azureMachine, }) g.Expect(err).NotTo(HaveOccurred()) diff --git a/controllers/helpers.go b/controllers/helpers.go index 67ad4762cbc..0804e97dd7d 100644 --- a/controllers/helpers.go +++ b/controllers/helpers.go @@ -149,7 +149,7 @@ func referSameObject(a, b metav1.OwnerReference) bool { } // GetCloudProviderSecret returns the required azure json secret for the provided parameters. -func GetCloudProviderSecret(d azure.ClusterDescriber, namespace, name string, owner metav1.OwnerReference, identityType infrav1.VMIdentity, userIdentityID string) (*corev1.Secret, error) { +func GetCloudProviderSecret(d azure.ClusterScoper, namespace, name string, owner metav1.OwnerReference, identityType infrav1.VMIdentity, userIdentityID string) (*corev1.Secret, error) { secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, @@ -192,7 +192,7 @@ func GetCloudProviderSecret(d azure.ClusterDescriber, namespace, name string, ow return secret, nil } -func systemAssignedIdentityCloudProviderConfig(d azure.ClusterDescriber) (*CloudProviderConfig, *CloudProviderConfig) { +func systemAssignedIdentityCloudProviderConfig(d azure.ClusterScoper) (*CloudProviderConfig, *CloudProviderConfig) { controlPlaneConfig, workerConfig := newCloudProviderConfig(d) controlPlaneConfig.AadClientID = "" controlPlaneConfig.AadClientSecret = "" @@ -200,7 +200,7 @@ func systemAssignedIdentityCloudProviderConfig(d azure.ClusterDescriber) (*Cloud return controlPlaneConfig, workerConfig } -func userAssignedIdentityCloudProviderConfig(d azure.ClusterDescriber, identityID string) (*CloudProviderConfig, *CloudProviderConfig) { +func userAssignedIdentityCloudProviderConfig(d azure.ClusterScoper, identityID string) (*CloudProviderConfig, *CloudProviderConfig) { controlPlaneConfig, workerConfig := newCloudProviderConfig(d) controlPlaneConfig.AadClientID = "" controlPlaneConfig.AadClientSecret = "" @@ -209,7 +209,7 @@ func userAssignedIdentityCloudProviderConfig(d azure.ClusterDescriber, identityI return controlPlaneConfig, workerConfig } -func newCloudProviderConfig(d azure.ClusterDescriber) (controlPlaneConfig *CloudProviderConfig, workerConfig *CloudProviderConfig) { +func newCloudProviderConfig(d azure.ClusterScoper) (controlPlaneConfig *CloudProviderConfig, workerConfig *CloudProviderConfig) { return &CloudProviderConfig{ Cloud: d.CloudEnvironment(), AadClientID: d.ClientID(), diff --git a/exp/controllers/azuremachinepool_controller.go b/exp/controllers/azuremachinepool_controller.go index 084472b7202..784c77ee5b0 100644 --- a/exp/controllers/azuremachinepool_controller.go +++ b/exp/controllers/azuremachinepool_controller.go @@ -190,7 +190,7 @@ func (r *AzureMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, Client: r.Client, MachinePool: machinePool, AzureMachinePool: azMachinePool, - ClusterDescriber: clusterScope, + ClusterScope: clusterScope, }) if err != nil { return reconcile.Result{}, errors.Errorf("failed to create scope: %+v", err) diff --git a/exp/controllers/azuremachinepool_controller_unit_test.go b/exp/controllers/azuremachinepool_controller_unit_test.go index 87ceb190554..ea2e1bb550c 100644 --- a/exp/controllers/azuremachinepool_controller_unit_test.go +++ b/exp/controllers/azuremachinepool_controller_unit_test.go @@ -50,14 +50,14 @@ func Test_newAzureMachinePoolService(t *testing.T) { AzureCluster: cluster, } - clusterMock := mocks.NewMockClusterDescriber(mockCtrl) + clusterMock := mocks.NewMockClusterScoper(mockCtrl) clusterMock.EXPECT().SubscriptionID().AnyTimes() clusterMock.EXPECT().BaseURI().AnyTimes() clusterMock.EXPECT().Authorizer().AnyTimes() mps := &scope.MachinePoolScope{ - ClusterDescriber: clusterMock, - MachinePool: newMachinePool("foo", "poolName"), + ClusterScoper: clusterMock, + MachinePool: newMachinePool("foo", "poolName"), AzureMachinePool: &infrav1exp.AzureMachinePool{ ObjectMeta: metav1.ObjectMeta{ Name: "poolName",