chore(terraform): use a util func to build internal terraform id (#869)
This commit is contained in:
parent
801ef6033d
commit
b313ef6a39
72 changed files with 205 additions and 538 deletions
|
|
@ -1360,14 +1360,8 @@ func mapFields(ctx context.Context, cl *ske.Cluster, m *Model, region string) er
|
|||
return fmt.Errorf("name not present")
|
||||
}
|
||||
m.Name = types.StringValue(name)
|
||||
idParts := []string{
|
||||
m.ProjectId.ValueString(),
|
||||
region,
|
||||
name,
|
||||
}
|
||||
m.Id = types.StringValue(
|
||||
strings.Join(idParts, core.Separator),
|
||||
)
|
||||
|
||||
m.Id = utils.BuildInternalTerraformId(m.ProjectId.ValueString(), region, name)
|
||||
m.Region = types.StringValue(region)
|
||||
|
||||
if cl.Kubernetes != nil {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
skeUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/ske/utils"
|
||||
|
|
@ -348,13 +347,8 @@ func mapFields(kubeconfigResp *ske.Kubeconfig, model *Model, creationTime time.T
|
|||
return fmt.Errorf("model input is nil")
|
||||
}
|
||||
|
||||
idParts := []string{
|
||||
model.ProjectId.ValueString(),
|
||||
model.ClusterName.ValueString(),
|
||||
model.KubeconfigId.ValueString(),
|
||||
}
|
||||
model.Id = types.StringValue(
|
||||
strings.Join(idParts, core.Separator),
|
||||
model.Id = utils.BuildInternalTerraformId(
|
||||
model.ProjectId.ValueString(), model.ClusterName.ValueString(), model.KubeconfigId.ValueString(),
|
||||
)
|
||||
|
||||
if kubeconfigResp.Kubeconfig == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue