fix: refactor sqlserver handle optional encryption
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 4s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 16m22s
CI Workflow / CI (pull_request) Failing after 20m8s
CI Workflow / Code coverage report (pull_request) Has been skipped
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 4s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 16m22s
CI Workflow / CI (pull_request) Failing after 20m8s
CI Workflow / Code coverage report (pull_request) Has been skipped
This commit is contained in:
parent
a5a388f238
commit
11573835dc
2 changed files with 20 additions and 11 deletions
|
|
@ -175,12 +175,18 @@ func toCreatePayload(
|
|||
storagePayload.Size = conversion.Int64ValueToPointer(storage.Size)
|
||||
}
|
||||
|
||||
encryptionPayload := &sqlserverflex.CreateInstanceRequestPayloadGetEncryptionArgType{}
|
||||
if encryption != nil {
|
||||
encryptionPayload.KekKeyId = conversion.StringValueToPointer(encryption.KeyId)
|
||||
encryptionPayload.KekKeyVersion = conversion.StringValueToPointer(encryption.KeyVersion)
|
||||
encryptionPayload.KekKeyRingId = conversion.StringValueToPointer(encryption.KeyRingId)
|
||||
encryptionPayload.ServiceAccount = conversion.StringValueToPointer(encryption.ServiceAccount)
|
||||
var encryptionPayload *sqlserverflex.CreateInstanceRequestPayloadGetEncryptionArgType
|
||||
if encryption != nil &&
|
||||
!encryption.KeyId.IsNull() && !encryption.KeyId.IsUnknown() &&
|
||||
!encryption.KeyRingId.IsNull() && !encryption.KeyRingId.IsUnknown() &&
|
||||
!encryption.KeyVersion.IsNull() && !encryption.KeyVersion.IsUnknown() &&
|
||||
!encryption.ServiceAccount.IsNull() && !encryption.ServiceAccount.IsUnknown() {
|
||||
encryptionPayload = &sqlserverflex.CreateInstanceRequestPayloadGetEncryptionArgType{
|
||||
KekKeyId: conversion.StringValueToPointer(encryption.KeyId),
|
||||
KekKeyRingId: conversion.StringValueToPointer(encryption.KeyVersion),
|
||||
KekKeyVersion: conversion.StringValueToPointer(encryption.KeyRingId),
|
||||
ServiceAccount: conversion.StringValueToPointer(encryption.ServiceAccount),
|
||||
}
|
||||
}
|
||||
|
||||
var aclElements []string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue