noop rename clusterskeyvault -> clusterkeyvault

This commit is contained in:
Jim Minter 2021-02-23 12:57:53 -06:00
Родитель c5d705ceba
Коммит 35930453a3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 0730CBDA10D1A2D3
7 изменённых файлов: 32 добавлений и 32 удалений

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

@ -248,13 +248,13 @@ func (m *manager) Delete(ctx context.Context) error {
if managedDomain != "" {
m.log.Print("deleting signed apiserver certificate")
err = m.env.ClustersKeyvault().EnsureCertificateDeleted(ctx, m.doc.ID+"-apiserver")
err = m.env.ClusterKeyvault().EnsureCertificateDeleted(ctx, m.doc.ID+"-apiserver")
if err != nil {
return err
}
m.log.Print("deleting signed ingress certificate")
err = m.env.ClustersKeyvault().EnsureCertificateDeleted(ctx, m.doc.ID+"-ingress")
err = m.env.ClusterKeyvault().EnsureCertificateDeleted(ctx, m.doc.ID+"-ingress")
if err != nil {
return err
}

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

@ -51,7 +51,7 @@ func (m *manager) createCertificates(ctx context.Context) error {
for _, c := range certs {
m.log.Printf("creating certificate %s", c.certificateName)
err = m.env.ClustersKeyvault().CreateSignedCertificate(ctx, keyvault.IssuerDigicert, c.certificateName, c.commonName, keyvault.EkuServerAuth)
err = m.env.ClusterKeyvault().CreateSignedCertificate(ctx, keyvault.IssuerDigicert, c.certificateName, c.commonName, keyvault.EkuServerAuth)
if err != nil {
return err
}
@ -59,7 +59,7 @@ func (m *manager) createCertificates(ctx context.Context) error {
for _, c := range certs {
m.log.Printf("waiting for certificate %s", c.certificateName)
err = m.env.ClustersKeyvault().WaitForCertificateOperation(ctx, c.certificateName)
err = m.env.ClusterKeyvault().WaitForCertificateOperation(ctx, c.certificateName)
if err != nil {
return err
}
@ -69,7 +69,7 @@ func (m *manager) createCertificates(ctx context.Context) error {
}
func (m *manager) ensureSecret(ctx context.Context, secrets coreclient.SecretInterface, certificateName string) error {
bundle, err := m.env.ClustersKeyvault().GetSecret(ctx, certificateName)
bundle, err := m.env.ClusterKeyvault().GetSecret(ctx, certificateName)
if err != nil {
return err
}

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

@ -1390,7 +1390,7 @@ func (g *generator) serviceKeyvaultAccessPolicies() []mgmtkeyvault.AccessPolicyE
}
}
func (g *generator) clustersKeyvault() *arm.Resource {
func (g *generator) clusterKeyvault() *arm.Resource {
vault := &mgmtkeyvault.Vault{
Properties: &mgmtkeyvault.VaultProperties{
EnableSoftDelete: to.BoolPtr(true),
@ -1401,7 +1401,7 @@ func (g *generator) clustersKeyvault() *arm.Resource {
},
AccessPolicies: &[]mgmtkeyvault.AccessPolicyEntry{},
},
Name: to.StringPtr("[concat(parameters('keyvaultPrefix'), '" + env.ClustersKeyvaultSuffix + "')]"),
Name: to.StringPtr("[concat(parameters('keyvaultPrefix'), '" + env.ClusterKeyvaultSuffix + "')]"),
Type: to.StringPtr("Microsoft.KeyVault/vaults"),
Location: to.StringPtr("[resourceGroup().location]"),
}

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

@ -327,7 +327,7 @@ func (g *generator) preDeployTemplate() *arm.Template {
p.Type = "array"
p.DefaultValue = []string{}
case "keyvaultPrefix":
p.MaxLength = 24 - max(len(env.ClustersKeyvaultSuffix), len(env.ServiceKeyvaultSuffix), len(env.PortalKeyvaultSuffix))
p.MaxLength = 24 - max(len(env.ClusterKeyvaultSuffix), len(env.ServiceKeyvaultSuffix), len(env.PortalKeyvaultSuffix))
}
t.Parameters[param] = p
}
@ -335,9 +335,9 @@ func (g *generator) preDeployTemplate() *arm.Template {
t.Resources = append(t.Resources,
g.securityGroupRP(),
g.securityGroupPE(),
// clustersKeyvault, portalKeyvault and serviceKeyvault must be in this
// clusterKeyvault, portalKeyvault and serviceKeyvault must be in this
// order due to terrible bytes.Replace in templateFixup
g.clustersKeyvault(),
g.clusterKeyvault(),
g.portalKeyvault(),
g.serviceKeyvault(),
)

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

@ -30,7 +30,7 @@ const (
PortalServerClientSecretName = "portal-client"
PortalServerSessionKeySecretName = "portal-session-key"
PortalServerSSHKeySecretName = "portal-sshkey"
ClustersKeyvaultSuffix = "-cls"
ClusterKeyvaultSuffix = "-cls"
PortalKeyvaultSuffix = "-por"
ServiceKeyvaultSuffix = "-svc"
)
@ -46,7 +46,7 @@ type Interface interface {
ClustersGenevaLoggingConfigVersion() string
ClustersGenevaLoggingEnvironment() string
ClustersGenevaLoggingSecret() (*rsa.PrivateKey, *x509.Certificate)
ClustersKeyvault() keyvault.Manager
ClusterKeyvault() keyvault.Manager
Domain() string
FPAuthorizer(string, string) (refreshable.Authorizer, error)
Listen() (net.Listener, error)

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

@ -39,8 +39,8 @@ type prod struct {
fpPrivateKey *rsa.PrivateKey
fpClientID string
clustersKeyvault keyvault.Manager
serviceKeyvault keyvault.Manager
clusterKeyvault keyvault.Manager
serviceKeyvault keyvault.Manager
clustersGenevaLoggingCertificate *x509.Certificate
clustersGenevaLoggingPrivateKey *rsa.PrivateKey
@ -89,7 +89,7 @@ func newProd(ctx context.Context, log *logrus.Entry) (*prod, error) {
return nil, err
}
clustersKeyvaultURI, err := keyvault.URI(p, ClustersKeyvaultSuffix)
clusterKeyvaultURI, err := keyvault.URI(p, ClusterKeyvaultSuffix)
if err != nil {
return nil, err
}
@ -99,7 +99,7 @@ func newProd(ctx context.Context, log *logrus.Entry) (*prod, error) {
return nil, err
}
p.clustersKeyvault = keyvault.NewManager(rpKVAuthorizer, clustersKeyvaultURI)
p.clusterKeyvault = keyvault.NewManager(rpKVAuthorizer, clusterKeyvaultURI)
p.serviceKeyvault = keyvault.NewManager(rpKVAuthorizer, serviceKeyvaultURI)
err = p.populateZones(ctx, rpAuthorizer)
@ -211,8 +211,8 @@ func (p *prod) ClustersGenevaLoggingSecret() (*rsa.PrivateKey, *x509.Certificate
return p.clustersGenevaLoggingPrivateKey, p.clustersGenevaLoggingCertificate
}
func (p *prod) ClustersKeyvault() keyvault.Manager {
return p.clustersKeyvault
func (p *prod) ClusterKeyvault() keyvault.Manager {
return p.clusterKeyvault
}
func (p *prod) Domain() string {

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

@ -250,6 +250,20 @@ func (mr *MockInterfaceMockRecorder) ArmClientAuthorizer() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ArmClientAuthorizer", reflect.TypeOf((*MockInterface)(nil).ArmClientAuthorizer))
}
// ClusterKeyvault mocks base method
func (m *MockInterface) ClusterKeyvault() keyvault.Manager {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClusterKeyvault")
ret0, _ := ret[0].(keyvault.Manager)
return ret0
}
// ClusterKeyvault indicates an expected call of ClusterKeyvault
func (mr *MockInterfaceMockRecorder) ClusterKeyvault() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClusterKeyvault", reflect.TypeOf((*MockInterface)(nil).ClusterKeyvault))
}
// ClustersGenevaLoggingConfigVersion mocks base method
func (m *MockInterface) ClustersGenevaLoggingConfigVersion() string {
m.ctrl.T.Helper()
@ -293,20 +307,6 @@ func (mr *MockInterfaceMockRecorder) ClustersGenevaLoggingSecret() *gomock.Call
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClustersGenevaLoggingSecret", reflect.TypeOf((*MockInterface)(nil).ClustersGenevaLoggingSecret))
}
// ClustersKeyvault mocks base method
func (m *MockInterface) ClustersKeyvault() keyvault.Manager {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClustersKeyvault")
ret0, _ := ret[0].(keyvault.Manager)
return ret0
}
// ClustersKeyvault indicates an expected call of ClustersKeyvault
func (mr *MockInterfaceMockRecorder) ClustersKeyvault() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClustersKeyvault", reflect.TypeOf((*MockInterface)(nil).ClustersKeyvault))
}
// CreateARMResourceGroupRoleAssignment mocks base method
func (m *MockInterface) CreateARMResourceGroupRoleAssignment(arg0 context.Context, arg1 refreshable.Authorizer, arg2 string) error {
m.ctrl.T.Helper()