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)
|
storagePayload.Size = conversion.Int64ValueToPointer(storage.Size)
|
||||||
}
|
}
|
||||||
|
|
||||||
encryptionPayload := &sqlserverflex.CreateInstanceRequestPayloadGetEncryptionArgType{}
|
var encryptionPayload *sqlserverflex.CreateInstanceRequestPayloadGetEncryptionArgType
|
||||||
if encryption != nil {
|
if encryption != nil &&
|
||||||
encryptionPayload.KekKeyId = conversion.StringValueToPointer(encryption.KeyId)
|
!encryption.KeyId.IsNull() && !encryption.KeyId.IsUnknown() &&
|
||||||
encryptionPayload.KekKeyVersion = conversion.StringValueToPointer(encryption.KeyVersion)
|
!encryption.KeyRingId.IsNull() && !encryption.KeyRingId.IsUnknown() &&
|
||||||
encryptionPayload.KekKeyRingId = conversion.StringValueToPointer(encryption.KeyRingId)
|
!encryption.KeyVersion.IsNull() && !encryption.KeyVersion.IsUnknown() &&
|
||||||
encryptionPayload.ServiceAccount = conversion.StringValueToPointer(encryption.ServiceAccount)
|
!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
|
var aclElements []string
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,15 @@ import (
|
||||||
sqlserverflex "tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/pkg_gen/sqlserverflexalpha"
|
sqlserverflex "tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/pkg_gen/sqlserverflexalpha"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// READY, PENDING, PROGRESSING, FAILURE, UNKNOWN,
|
||||||
const (
|
const (
|
||||||
InstanceStateEmpty = ""
|
InstanceStateEmpty = ""
|
||||||
InstanceStateProcessing = "Progressing"
|
InstanceStateSuccess = "READY"
|
||||||
InstanceStateUnknown = "Unknown"
|
InstanceStatePending = "PENDING"
|
||||||
InstanceStateSuccess = "Ready"
|
InstanceStateProcessing = "PROGRESSING"
|
||||||
InstanceStateFailed = "Failed"
|
InstanceStateFailed = "FAILURE"
|
||||||
|
InstanceStateUnknown = "UNKNOWN"
|
||||||
|
InstanceStateTerminating = "TERMINATING"
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIClientInstanceInterface Interface needed for tests
|
// APIClientInstanceInterface Interface needed for tests
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue