Add definitions to Type for interface, remove RP_MODE checks, and regenerate mocks

This commit is contained in:
Amber Brown 2020-08-05 12:03:33 +10:00
Родитель a8a8151509
Коммит 09b8718f01
20 изменённых файлов: 133 добавлений и 470 удалений

Просмотреть файл

@ -31,7 +31,7 @@ func monitor(ctx context.Context, log *logrus.Entry) error {
return err
}
if _, ok := _env.(env.Dev); !ok {
if !_env.IsDevelopment() {
for _, key := range []string{
"CLUSTER_MDM_ACCOUNT",
"CLUSTER_MDM_NAMESPACE",

Просмотреть файл

@ -44,7 +44,7 @@ func rp(ctx context.Context, log *logrus.Entry) error {
}
var keys []string
if _, ok := _env.(env.Dev); ok {
if _env.IsDevelopment() {
keys = []string{
"PULL_SECRET",
}

Просмотреть файл

@ -31,7 +31,6 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/env"
"github.com/Azure/ARO-RP/pkg/genevalogging"
"github.com/Azure/ARO-RP/pkg/install"
"github.com/Azure/ARO-RP/pkg/util/azureerrors"
@ -66,7 +65,7 @@ func (m *Manager) Create(ctx context.Context) error {
resourceGroup := stringutils.LastTokenByte(m.doc.OpenShiftCluster.Properties.ClusterProfile.ResourceGroupID, '/')
if _, ok := m.env.(env.Dev); !ok {
if !m.env.IsDevelopment() {
rp := m.acrtoken.GetRegistryProfile(m.doc.OpenShiftCluster)
if rp == nil {
// 1. choose a name and establish the intent to create a token with

Просмотреть файл

@ -13,7 +13,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/env"
"github.com/Azure/ARO-RP/pkg/util/stringutils"
)
@ -100,7 +99,7 @@ func (m *Manager) Delete(ctx context.Context) error {
return err
}
if _, ok := m.env.(env.Dev); !ok {
if !m.env.IsDevelopment() {
managedDomain, err := m.env.ManagedDomain(m.doc.OpenShiftCluster.Properties.ClusterProfile.Domain)
if err != nil {
return err
@ -131,7 +130,7 @@ func (m *Manager) Delete(ctx context.Context) error {
return err
}
if _, ok := m.env.(env.Dev); !ok {
if !m.env.IsDevelopment() {
rp := m.acrtoken.GetRegistryProfile(m.doc.OpenShiftCluster)
if rp != nil {
err = m.acrtoken.Delete(ctx, rp)

Просмотреть файл

@ -62,7 +62,7 @@ func NewManager(log *logrus.Entry, _env env.Interface, db database.OpenShiftClus
}
var acrtoken pkgacrtoken.Manager
if _, ok := _env.(env.Dev); !ok {
if !_env.IsDevelopment() {
acrtoken, err = pkgacrtoken.NewManager(_env, localFPAuthorizer)
if err != nil {
return nil, err

5
pkg/env/dev.go поставляемый
Просмотреть файл

@ -109,6 +109,7 @@ func newDev(ctx context.Context, log *logrus.Entry, instancemetadata instancemet
}
d.prod.clustersGenevaLoggingEnvironment = "Test"
d.prod.clustersGenevaLoggingConfigVersion = "2.3"
d.prod.envType = environmentTypeDevelopment
fpGraphAuthorizer, err := d.FPAuthorizer(instancemetadata.TenantID(), azure.PublicCloud.GraphEndpoint)
if err != nil {
@ -295,3 +296,7 @@ func (d *dev) E2EStorageAccountRGName() string {
func (d *dev) E2EStorageAccountSubID() string {
return "0cc1cafa-578f-4fa5-8d6b-ddfd8d82e6ea"
}
func (d *dev) ShouldDeployDenyAssignment() bool {
return false
}

10
pkg/env/env.go поставляемый
Просмотреть файл

@ -20,6 +20,14 @@ import (
"github.com/Azure/ARO-RP/pkg/util/refreshable"
)
type environmentType uint8
const (
environmentTypeProduction environmentType = iota
environmentTypeDevelopment
environmentTypeIntegration
)
const (
RPFirstPartySecretName = "rp-firstparty"
RPServerSecretName = "rp-server"
@ -33,6 +41,7 @@ const (
type Interface interface {
instancemetadata.InstanceMetadata
IsDevelopment() bool
InitializeAuthorizers() error
ArmClientAuthorizer() clientauthorizer.ClientAuthorizer
AdminClientAuthorizer() clientauthorizer.ClientAuthorizer
@ -57,6 +66,7 @@ type Interface interface {
E2EStorageAccountName() string
E2EStorageAccountRGName() string
E2EStorageAccountSubID() string
ShouldDeployDenyAssignment() bool
}
func NewEnv(ctx context.Context, log *logrus.Entry) (Interface, error) {

46
pkg/env/env_test.go поставляемый Normal file
Просмотреть файл

@ -0,0 +1,46 @@
package env
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import "testing"
func TestEnvironmentType(t *testing.T) {
p := &prod{envType: environmentTypeProduction}
out := p.IsDevelopment()
if out != false {
t.Fatal("didn't return expected value")
}
p = &prod{envType: environmentTypeIntegration}
out = p.IsDevelopment()
if out != false {
t.Fatal("didn't return expected value")
}
p = &prod{envType: environmentTypeDevelopment}
out = p.IsDevelopment()
if out != true {
t.Fatal("didn't return expected value")
}
}
func TestEnvironmentShouldDeployDenyAssignment(t *testing.T) {
p := &prod{envType: environmentTypeProduction}
out := p.ShouldDeployDenyAssignment()
if out != true {
t.Fatal("didn't return expected value")
}
p = &prod{envType: environmentTypeIntegration}
out = p.ShouldDeployDenyAssignment()
if out != false {
t.Fatal("didn't return expected value")
}
p = &prod{envType: environmentTypeDevelopment}
out = p.ShouldDeployDenyAssignment()
if out != false {
t.Fatal("didn't return expected value")
}
}

2
pkg/env/generate.go поставляемый
Просмотреть файл

@ -1,4 +1,4 @@
//go:generate go run ../../vendor/github.com/golang/mock/mockgen -destination=../util/mocks/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/$GOPACKAGE Interface,Dev
//go:generate go run ../../vendor/github.com/golang/mock/mockgen -destination=../util/mocks/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/$GOPACKAGE Interface
//go:generate go run ../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/Azure/ARO-RP -e -w ../util/mocks/$GOPACKAGE/$GOPACKAGE.go
package env

1
pkg/env/int.go поставляемый
Просмотреть файл

@ -36,6 +36,7 @@ func newInt(ctx context.Context, log *logrus.Entry, instancemetadata instancemet
p.e2eStorageAccountName = "arov4e2eint"
p.e2eStorageAccountRGName = "global-infra"
p.e2eStorageAccountSubID = "0cc1cafa-578f-4fa5-8d6b-ddfd8d82e6ea"
p.envType = environmentTypeIntegration
return p, nil
}

14
pkg/env/prod.go поставляемый
Просмотреть файл

@ -60,7 +60,8 @@ type prod struct {
e2eStorageAccountRGName string
e2eStorageAccountSubID string
log *logrus.Entry
log *logrus.Entry
envType environmentType
}
func newProd(ctx context.Context, log *logrus.Entry, instancemetadata instancemetadata.InstanceMetadata, rpAuthorizer, kvAuthorizer autorest.Authorizer) (*prod, error) {
@ -72,7 +73,8 @@ func newProd(ctx context.Context, log *logrus.Entry, instancemetadata instanceme
clustersGenevaLoggingEnvironment: "DiagnosticsProd",
clustersGenevaLoggingConfigVersion: "2.2",
log: log,
log: log,
envType: environmentTypeProduction,
}
err := p.populateCosmosDB(ctx, rpAuthorizer)
@ -383,3 +385,11 @@ func (p *prod) E2EStorageAccountRGName() string {
func (p *prod) E2EStorageAccountSubID() string {
return p.e2eStorageAccountSubID
}
func (p *prod) ShouldDeployDenyAssignment() bool {
return p.envType == environmentTypeProduction
}
func (p *prod) IsDevelopment() bool {
return p.envType == environmentTypeDevelopment
}

Просмотреть файл

@ -19,7 +19,7 @@ func Headers(_env env.Interface) func(http.Handler) http.Handler {
w.Header().Set("X-Ms-Client-Request-Id", r.Header.Get("X-Ms-Client-Request-Id"))
}
if _, ok := _env.(env.Dev); ok {
if _env.IsDevelopment() {
r.Header.Set("Referer", "https://localhost:8443"+r.URL.String())
}

Просмотреть файл

@ -8,7 +8,6 @@ import (
"time"
"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/env"
)
// checkReady checks the ready status of the frontend to make it consistent
@ -16,7 +15,7 @@ import (
// minutes before indicating health. This ensures that there will be a gap in
// our health metric if we crash or restart.
func (f *frontend) checkReady() bool {
if _, ok := f.env.(env.Dev); !ok &&
if !f.env.IsDevelopment() &&
time.Now().Sub(f.startTime) < 2*time.Minute {
return false
}

Просмотреть файл

@ -6,7 +6,6 @@ package install
import (
"context"
"net/http"
"os"
"reflect"
"strings"
"time"
@ -113,7 +112,7 @@ func (i *Installer) deployStorageTemplate(ctx context.Context, installConfig *in
Location: &installConfig.Config.Azure.Region,
ManagedBy: to.StringPtr(i.doc.OpenShiftCluster.ID),
}
if _, ok := i.env.(env.Dev); ok {
if i.env.IsDevelopment() {
group.ManagedBy = nil
}
_, err := i.groups.CreateOrUpdate(ctx, resourceGroup, group)
@ -193,7 +192,7 @@ func (i *Installer) deployStorageTemplate(ctx context.Context, installConfig *in
},
}
if os.Getenv("RP_MODE") == "" { // production
if i.env.ShouldDeployDenyAssignment() {
t.Resources = append(t.Resources, i.denyAssignments(clusterSPObjectID))
}
@ -286,7 +285,7 @@ func (i *Installer) denyAssignments(clusterSPObjectID string) *arm.Resource {
}
func (i *Installer) deploySnapshotUpgradeTemplate(ctx context.Context) error {
if os.Getenv("RP_MODE") != "" {
if !i.env.ShouldDeployDenyAssignment() {
// only need this upgrade in production, where there are DenyAssignments
return nil
}

Просмотреть файл

@ -11,13 +11,11 @@ import (
configscheme "github.com/openshift/client-go/config/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/util/retry"
"github.com/Azure/ARO-RP/pkg/env"
)
// disableSamples disables the samples if there's no appropriate pull secret
func (i *Installer) disableSamples(ctx context.Context) error {
if _, ok := i.env.(env.Dev); !ok &&
if !i.env.IsDevelopment() &&
i.doc.OpenShiftCluster.Properties.ClusterProfile.PullSecret != "" {
return nil
}
@ -38,7 +36,7 @@ func (i *Installer) disableSamples(ctx context.Context) error {
// disableOperatorHubSources disables operator hub sources if there's no
// appropriate pull secret
func (i *Installer) disableOperatorHubSources(ctx context.Context) error {
if _, ok := i.env.(env.Dev); !ok &&
if !i.env.IsDevelopment() &&
i.doc.OpenShiftCluster.Properties.ClusterProfile.PullSecret != "" {
return nil
}

Просмотреть файл

@ -15,13 +15,12 @@ import (
coreclient "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/util/retry"
"github.com/Azure/ARO-RP/pkg/env"
"github.com/Azure/ARO-RP/pkg/util/keyvault"
utilpem "github.com/Azure/ARO-RP/pkg/util/pem"
)
func (i *Installer) createCertificates(ctx context.Context) error {
if _, ok := i.env.(env.Dev); ok {
if i.env.IsDevelopment() {
return nil
}
@ -68,7 +67,7 @@ func (i *Installer) createCertificates(ctx context.Context) error {
}
func (i *Installer) upgradeCertificates(ctx context.Context) error {
if _, ok := i.env.(env.Dev); ok {
if i.env.IsDevelopment() {
return nil
}
@ -144,7 +143,7 @@ func (i *Installer) ensureSecret(ctx context.Context, secrets coreclient.SecretI
}
func (i *Installer) configureAPIServerCertificate(ctx context.Context) error {
if _, ok := i.env.(env.Dev); ok {
if i.env.IsDevelopment() {
return nil
}
@ -185,7 +184,7 @@ func (i *Installer) configureAPIServerCertificate(ctx context.Context) error {
}
func (i *Installer) configureIngressCertificate(ctx context.Context) error {
if _, ok := i.env.(env.Dev); ok {
if i.env.IsDevelopment() {
return nil
}

Просмотреть файл

@ -129,7 +129,7 @@ func (s *statsd) write(m *metric) (err error) {
if s.conn == nil {
err = s.dial()
if err != nil {
if _, ok := s.env.(env.Dev); ok {
if s.env.IsDevelopment() {
err = nil
}
return

Просмотреть файл

@ -48,7 +48,7 @@ type manager struct {
func NewManager(_env env.Interface, billing database.Billing, sub database.Subscriptions, log *logrus.Entry) (Manager, error) {
var storageClient *azstorage.Client
if _, ok := _env.(env.Dev); !ok {
if !_env.IsDevelopment() {
localFPAuthorizer, err := _env.FPAuthorizer(_env.TenantID(), azure.PublicCloud.ResourceManagerEndpoint)
if err != nil {
return nil, err
@ -137,7 +137,7 @@ func isSubscriptionRegisteredForE2E(sub *api.SubscriptionProperties) bool {
// storage account. This is used later on by the billing e2e
func (m *manager) createOrUpdateE2EBlob(ctx context.Context, doc *api.BillingDocument) error {
//skip updating the storage account if this is a dev scenario
if _, ok := m.env.(env.Dev); ok {
if m.env.IsDevelopment() {
return nil
}

Просмотреть файл

@ -16,6 +16,7 @@ import (
"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/database/cosmosdb"
mock_database "github.com/Azure/ARO-RP/pkg/util/mocks/database"
mock_env "github.com/Azure/ARO-RP/pkg/util/mocks/env"
)
func TestIsSubscriptionRegisteredForE2E(t *testing.T) {
@ -235,6 +236,9 @@ func TestDelete(t *testing.T) {
controller := gomock.NewController(t)
defer controller.Finish()
_env := mock_env.NewMockInterface(controller)
_env.EXPECT().IsDevelopment().AnyTimes().Return(false)
log := logrus.NewEntry(logrus.StandardLogger())
billingDB := mock_database.NewMockBilling(controller)
@ -246,6 +250,7 @@ func TestDelete(t *testing.T) {
log: log,
billingDB: billingDB,
subDB: subsDB,
env: _env,
}
err := m.Delete(ctx, tt.openshiftdoc)
@ -397,6 +402,9 @@ func TestEnsure(t *testing.T) {
controller := gomock.NewController(t)
defer controller.Finish()
_env := mock_env.NewMockInterface(controller)
_env.EXPECT().IsDevelopment().AnyTimes().Return(false)
log := logrus.NewEntry(logrus.StandardLogger())
billingDB := mock_database.NewMockBilling(controller)
@ -408,6 +416,7 @@ func TestEnsure(t *testing.T) {
log: log,
billingDB: billingDB,
subDB: subsDB,
env: _env,
}
err := m.Ensure(ctx, tt.openshiftdoc)

469
pkg/util/mocks/env/env.go поставляемый
Просмотреть файл

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/Azure/ARO-RP/pkg/env (interfaces: Interface,Dev)
// Source: github.com/Azure/ARO-RP/pkg/env (interfaces: Interface)
// Package mock_env is a generated GoMock package.
package mock_env
@ -327,6 +327,20 @@ func (mr *MockInterfaceMockRecorder) InitializeAuthorizers() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeAuthorizers", reflect.TypeOf((*MockInterface)(nil).InitializeAuthorizers))
}
// IsDevelopment mocks base method
func (m *MockInterface) IsDevelopment() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsDevelopment")
ret0, _ := ret[0].(bool)
return ret0
}
// IsDevelopment indicates an expected call of IsDevelopment
func (mr *MockInterfaceMockRecorder) IsDevelopment() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDevelopment", reflect.TypeOf((*MockInterface)(nil).IsDevelopment))
}
// Listen mocks base method
func (m *MockInterface) Listen() (net.Listener, error) {
m.ctrl.T.Helper()
@ -399,6 +413,20 @@ func (mr *MockInterfaceMockRecorder) ResourceGroup() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResourceGroup", reflect.TypeOf((*MockInterface)(nil).ResourceGroup))
}
// ShouldDeployDenyAssignment mocks base method
func (m *MockInterface) ShouldDeployDenyAssignment() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ShouldDeployDenyAssignment")
ret0, _ := ret[0].(bool)
return ret0
}
// ShouldDeployDenyAssignment indicates an expected call of ShouldDeployDenyAssignment
func (mr *MockInterfaceMockRecorder) ShouldDeployDenyAssignment() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldDeployDenyAssignment", reflect.TypeOf((*MockInterface)(nil).ShouldDeployDenyAssignment))
}
// SubscriptionID mocks base method
func (m *MockInterface) SubscriptionID() string {
m.ctrl.T.Helper()
@ -441,442 +469,3 @@ func (mr *MockInterfaceMockRecorder) Zones(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Zones", reflect.TypeOf((*MockInterface)(nil).Zones), arg0)
}
// MockDev is a mock of Dev interface
type MockDev struct {
ctrl *gomock.Controller
recorder *MockDevMockRecorder
}
// MockDevMockRecorder is the mock recorder for MockDev
type MockDevMockRecorder struct {
mock *MockDev
}
// NewMockDev creates a new mock instance
func NewMockDev(ctrl *gomock.Controller) *MockDev {
mock := &MockDev{ctrl: ctrl}
mock.recorder = &MockDevMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockDev) EXPECT() *MockDevMockRecorder {
return m.recorder
}
// ACRName mocks base method
func (m *MockDev) ACRName() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ACRName")
ret0, _ := ret[0].(string)
return ret0
}
// ACRName indicates an expected call of ACRName
func (mr *MockDevMockRecorder) ACRName() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ACRName", reflect.TypeOf((*MockDev)(nil).ACRName))
}
// ACRResourceID mocks base method
func (m *MockDev) ACRResourceID() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ACRResourceID")
ret0, _ := ret[0].(string)
return ret0
}
// ACRResourceID indicates an expected call of ACRResourceID
func (mr *MockDevMockRecorder) ACRResourceID() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ACRResourceID", reflect.TypeOf((*MockDev)(nil).ACRResourceID))
}
// AROOperatorImage mocks base method
func (m *MockDev) AROOperatorImage() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AROOperatorImage")
ret0, _ := ret[0].(string)
return ret0
}
// AROOperatorImage indicates an expected call of AROOperatorImage
func (mr *MockDevMockRecorder) AROOperatorImage() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AROOperatorImage", reflect.TypeOf((*MockDev)(nil).AROOperatorImage))
}
// AdminClientAuthorizer mocks base method
func (m *MockDev) AdminClientAuthorizer() clientauthorizer.ClientAuthorizer {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AdminClientAuthorizer")
ret0, _ := ret[0].(clientauthorizer.ClientAuthorizer)
return ret0
}
// AdminClientAuthorizer indicates an expected call of AdminClientAuthorizer
func (mr *MockDevMockRecorder) AdminClientAuthorizer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdminClientAuthorizer", reflect.TypeOf((*MockDev)(nil).AdminClientAuthorizer))
}
// ArmClientAuthorizer mocks base method
func (m *MockDev) ArmClientAuthorizer() clientauthorizer.ClientAuthorizer {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ArmClientAuthorizer")
ret0, _ := ret[0].(clientauthorizer.ClientAuthorizer)
return ret0
}
// ArmClientAuthorizer indicates an expected call of ArmClientAuthorizer
func (mr *MockDevMockRecorder) ArmClientAuthorizer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ArmClientAuthorizer", reflect.TypeOf((*MockDev)(nil).ArmClientAuthorizer))
}
// ClustersGenevaLoggingConfigVersion mocks base method
func (m *MockDev) ClustersGenevaLoggingConfigVersion() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClustersGenevaLoggingConfigVersion")
ret0, _ := ret[0].(string)
return ret0
}
// ClustersGenevaLoggingConfigVersion indicates an expected call of ClustersGenevaLoggingConfigVersion
func (mr *MockDevMockRecorder) ClustersGenevaLoggingConfigVersion() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClustersGenevaLoggingConfigVersion", reflect.TypeOf((*MockDev)(nil).ClustersGenevaLoggingConfigVersion))
}
// ClustersGenevaLoggingEnvironment mocks base method
func (m *MockDev) ClustersGenevaLoggingEnvironment() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClustersGenevaLoggingEnvironment")
ret0, _ := ret[0].(string)
return ret0
}
// ClustersGenevaLoggingEnvironment indicates an expected call of ClustersGenevaLoggingEnvironment
func (mr *MockDevMockRecorder) ClustersGenevaLoggingEnvironment() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClustersGenevaLoggingEnvironment", reflect.TypeOf((*MockDev)(nil).ClustersGenevaLoggingEnvironment))
}
// ClustersGenevaLoggingSecret mocks base method
func (m *MockDev) ClustersGenevaLoggingSecret() (*rsa.PrivateKey, *x509.Certificate) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClustersGenevaLoggingSecret")
ret0, _ := ret[0].(*rsa.PrivateKey)
ret1, _ := ret[1].(*x509.Certificate)
return ret0, ret1
}
// ClustersGenevaLoggingSecret indicates an expected call of ClustersGenevaLoggingSecret
func (mr *MockDevMockRecorder) ClustersGenevaLoggingSecret() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClustersGenevaLoggingSecret", reflect.TypeOf((*MockDev)(nil).ClustersGenevaLoggingSecret))
}
// ClustersKeyvaultURI mocks base method
func (m *MockDev) ClustersKeyvaultURI() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClustersKeyvaultURI")
ret0, _ := ret[0].(string)
return ret0
}
// ClustersKeyvaultURI indicates an expected call of ClustersKeyvaultURI
func (mr *MockDevMockRecorder) ClustersKeyvaultURI() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClustersKeyvaultURI", reflect.TypeOf((*MockDev)(nil).ClustersKeyvaultURI))
}
// CosmosDB mocks base method
func (m *MockDev) CosmosDB() (string, string) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CosmosDB")
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(string)
return ret0, ret1
}
// CosmosDB indicates an expected call of CosmosDB
func (mr *MockDevMockRecorder) CosmosDB() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CosmosDB", reflect.TypeOf((*MockDev)(nil).CosmosDB))
}
// CreateARMResourceGroupRoleAssignment mocks base method
func (m *MockDev) CreateARMResourceGroupRoleAssignment(arg0 context.Context, arg1 refreshable.Authorizer, arg2 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateARMResourceGroupRoleAssignment", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// CreateARMResourceGroupRoleAssignment indicates an expected call of CreateARMResourceGroupRoleAssignment
func (mr *MockDevMockRecorder) CreateARMResourceGroupRoleAssignment(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateARMResourceGroupRoleAssignment", reflect.TypeOf((*MockDev)(nil).CreateARMResourceGroupRoleAssignment), arg0, arg1, arg2)
}
// DatabaseName mocks base method
func (m *MockDev) DatabaseName() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DatabaseName")
ret0, _ := ret[0].(string)
return ret0
}
// DatabaseName indicates an expected call of DatabaseName
func (mr *MockDevMockRecorder) DatabaseName() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DatabaseName", reflect.TypeOf((*MockDev)(nil).DatabaseName))
}
// DialContext mocks base method
func (m *MockDev) DialContext(arg0 context.Context, arg1, arg2 string) (net.Conn, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DialContext", arg0, arg1, arg2)
ret0, _ := ret[0].(net.Conn)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DialContext indicates an expected call of DialContext
func (mr *MockDevMockRecorder) DialContext(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DialContext", reflect.TypeOf((*MockDev)(nil).DialContext), arg0, arg1, arg2)
}
// Domain mocks base method
func (m *MockDev) Domain() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Domain")
ret0, _ := ret[0].(string)
return ret0
}
// Domain indicates an expected call of Domain
func (mr *MockDevMockRecorder) Domain() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Domain", reflect.TypeOf((*MockDev)(nil).Domain))
}
// E2EStorageAccountName mocks base method
func (m *MockDev) E2EStorageAccountName() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "E2EStorageAccountName")
ret0, _ := ret[0].(string)
return ret0
}
// E2EStorageAccountName indicates an expected call of E2EStorageAccountName
func (mr *MockDevMockRecorder) E2EStorageAccountName() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "E2EStorageAccountName", reflect.TypeOf((*MockDev)(nil).E2EStorageAccountName))
}
// E2EStorageAccountRGName mocks base method
func (m *MockDev) E2EStorageAccountRGName() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "E2EStorageAccountRGName")
ret0, _ := ret[0].(string)
return ret0
}
// E2EStorageAccountRGName indicates an expected call of E2EStorageAccountRGName
func (mr *MockDevMockRecorder) E2EStorageAccountRGName() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "E2EStorageAccountRGName", reflect.TypeOf((*MockDev)(nil).E2EStorageAccountRGName))
}
// E2EStorageAccountSubID mocks base method
func (m *MockDev) E2EStorageAccountSubID() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "E2EStorageAccountSubID")
ret0, _ := ret[0].(string)
return ret0
}
// E2EStorageAccountSubID indicates an expected call of E2EStorageAccountSubID
func (mr *MockDevMockRecorder) E2EStorageAccountSubID() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "E2EStorageAccountSubID", reflect.TypeOf((*MockDev)(nil).E2EStorageAccountSubID))
}
// FPAuthorizer mocks base method
func (m *MockDev) FPAuthorizer(arg0, arg1 string) (refreshable.Authorizer, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FPAuthorizer", arg0, arg1)
ret0, _ := ret[0].(refreshable.Authorizer)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FPAuthorizer indicates an expected call of FPAuthorizer
func (mr *MockDevMockRecorder) FPAuthorizer(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FPAuthorizer", reflect.TypeOf((*MockDev)(nil).FPAuthorizer), arg0, arg1)
}
// GetCertificateSecret mocks base method
func (m *MockDev) GetCertificateSecret(arg0 context.Context, arg1 string) (*rsa.PrivateKey, []*x509.Certificate, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetCertificateSecret", arg0, arg1)
ret0, _ := ret[0].(*rsa.PrivateKey)
ret1, _ := ret[1].([]*x509.Certificate)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}
// GetCertificateSecret indicates an expected call of GetCertificateSecret
func (mr *MockDevMockRecorder) GetCertificateSecret(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCertificateSecret", reflect.TypeOf((*MockDev)(nil).GetCertificateSecret), arg0, arg1)
}
// GetSecret mocks base method
func (m *MockDev) GetSecret(arg0 context.Context, arg1 string) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSecret", arg0, arg1)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSecret indicates an expected call of GetSecret
func (mr *MockDevMockRecorder) GetSecret(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSecret", reflect.TypeOf((*MockDev)(nil).GetSecret), arg0, arg1)
}
// InitializeAuthorizers mocks base method
func (m *MockDev) InitializeAuthorizers() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "InitializeAuthorizers")
ret0, _ := ret[0].(error)
return ret0
}
// InitializeAuthorizers indicates an expected call of InitializeAuthorizers
func (mr *MockDevMockRecorder) InitializeAuthorizers() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeAuthorizers", reflect.TypeOf((*MockDev)(nil).InitializeAuthorizers))
}
// Listen mocks base method
func (m *MockDev) Listen() (net.Listener, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Listen")
ret0, _ := ret[0].(net.Listener)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Listen indicates an expected call of Listen
func (mr *MockDevMockRecorder) Listen() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Listen", reflect.TypeOf((*MockDev)(nil).Listen))
}
// Location mocks base method
func (m *MockDev) 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 *MockDevMockRecorder) Location() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Location", reflect.TypeOf((*MockDev)(nil).Location))
}
// ManagedDomain mocks base method
func (m *MockDev) ManagedDomain(arg0 string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ManagedDomain", arg0)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ManagedDomain indicates an expected call of ManagedDomain
func (mr *MockDevMockRecorder) ManagedDomain(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ManagedDomain", reflect.TypeOf((*MockDev)(nil).ManagedDomain), arg0)
}
// MetricsSocketPath mocks base method
func (m *MockDev) MetricsSocketPath() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MetricsSocketPath")
ret0, _ := ret[0].(string)
return ret0
}
// MetricsSocketPath indicates an expected call of MetricsSocketPath
func (mr *MockDevMockRecorder) MetricsSocketPath() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsSocketPath", reflect.TypeOf((*MockDev)(nil).MetricsSocketPath))
}
// ResourceGroup mocks base method
func (m *MockDev) 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 *MockDevMockRecorder) ResourceGroup() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResourceGroup", reflect.TypeOf((*MockDev)(nil).ResourceGroup))
}
// SubscriptionID mocks base method
func (m *MockDev) 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 *MockDevMockRecorder) SubscriptionID() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscriptionID", reflect.TypeOf((*MockDev)(nil).SubscriptionID))
}
// TenantID mocks base method
func (m *MockDev) 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 *MockDevMockRecorder) TenantID() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TenantID", reflect.TypeOf((*MockDev)(nil).TenantID))
}
// Zones mocks base method
func (m *MockDev) Zones(arg0 string) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Zones", arg0)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Zones indicates an expected call of Zones
func (mr *MockDevMockRecorder) Zones(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Zones", reflect.TypeOf((*MockDev)(nil).Zones), arg0)
}