Skip to content

Commit eb758cc

Browse files
authored
Merge pull request #5277 from nojnhuh/sp-cert
fix ServicePrincipalCertificate not reading from Secret
2 parents 4ff53b9 + 3bd4c57 commit eb758cc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

azure/scope/identity.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ func (p *AzureCredentialsProvider) hasClientSecret() bool {
212212
switch p.Identity.Spec.Type {
213213
case infrav1.ServicePrincipal, infrav1.ManualServicePrincipal:
214214
return true
215+
case infrav1.ServicePrincipalCertificate:
216+
return p.Identity.Spec.CertPath == ""
215217
default:
216218
return false
217219
}

azure/scope/identity_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ func TestHasClientSecret(t *testing.T) {
166166
Type: infrav1.ServicePrincipalCertificate,
167167
},
168168
},
169+
want: true,
170+
},
171+
{
172+
name: "service principal with certificate path",
173+
identity: &infrav1.AzureClusterIdentity{
174+
Spec: infrav1.AzureClusterIdentitySpec{
175+
Type: infrav1.ServicePrincipalCertificate,
176+
CertPath: "something",
177+
},
178+
},
169179
want: false,
170180
},
171181
{

0 commit comments

Comments
 (0)