Skip to content

Commit df477c5

Browse files
author
Matheus Politano
committed
merge with the main
1 parent 04a12a6 commit df477c5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

stackit/internal/services/cdn/customdomain/datasource.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ func mapCustomDomainDataSourceFields(customDomainResponse *cdn.GetCustomDomainRe
169169
if model == nil {
170170
return fmt.Errorf("model input is nil")
171171
}
172+
172173
if customDomainResponse.CustomDomain == nil {
173174
return fmt.Errorf("CustomDomain is missing in response")
174175
}
176+
175177
if customDomainResponse.CustomDomain.Name == nil {
176178
return fmt.Errorf("name is missing in response")
177179
}

stackit/internal/services/cdn/customdomain/resource.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,11 @@ func toCertificatePayload(ctx context.Context, model *CustomDomainModel) (*cdn.P
413413
if respDiags.HasError() {
414414
return nil, fmt.Errorf("invalid certificate or private key: %w", core.DiagsToError(respDiags))
415415
}
416+
416417
if utils.IsUndefined(certModel.Certificate) || utils.IsUndefined(certModel.PrivateKey) {
417418
return nil, fmt.Errorf(`"certificate" and "private_key" must be set`)
418419
}
420+
419421
certStr := base64.StdEncoding.EncodeToString([]byte(certModel.Certificate.ValueString()))
420422
keyStr := base64.StdEncoding.EncodeToString([]byte(certModel.PrivateKey.ValueString()))
421423

0 commit comments

Comments
 (0)