Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/talos/talos_client_configuration_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (d *talosClientConfigurationDataSource) Read(ctx context.Context, req datas
state.TalosConfig = basetypes.NewStringValue(string(talosConfigStringBytes))
state.ID = state.ClusterName

diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)

if resp.Diagnostics.HasError() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/talos/talos_cluster_health_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (d *talosClusterHealthDataSource) Read(ctx context.Context, req datasource.

state.ID = basetypes.NewStringValue("cluster_health")

resp.Diagnostics.Append(resp.State.Set(ctx, state)...)
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)

if resp.Diagnostics.HasError() {
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/talos/talos_cluster_kubeconfig_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (d *talosClusterKubeConfigDataSource) Read(ctx context.Context, req datasou

state.ID = basetypes.NewStringValue(clusterName)

diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)

if resp.Diagnostics.HasError() {
Expand Down
14 changes: 13 additions & 1 deletion pkg/talos/talos_cluster_kubeconfig_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"github.com/hashicorp/terraform-plugin-log/tflog"
Expand Down Expand Up @@ -63,6 +66,9 @@ func (r *talosClusterKubeConfigResource) Schema(ctx context.Context, _ resource.
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"node": schema.StringAttribute{
Required: true,
Expand Down Expand Up @@ -96,6 +102,9 @@ func (r *talosClusterKubeConfigResource) Schema(ctx context.Context, _ resource.
Computed: true,
Description: "The raw kubeconfig",
Sensitive: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"kubernetes_client_configuration": schema.SingleNestedAttribute{
Attributes: map[string]schema.Attribute{
Expand All @@ -119,6 +128,9 @@ func (r *talosClusterKubeConfigResource) Schema(ctx context.Context, _ resource.
},
Computed: true,
Description: "The kubernetes client configuration",
PlanModifiers: []planmodifier.Object{
objectplanmodifier.UseStateForUnknown(),
},
},
"timeouts": timeouts.Attributes(ctx, timeouts.Opts{
Create: true,
Expand Down Expand Up @@ -222,7 +234,7 @@ func (r *talosClusterKubeConfigResource) Create(ctx context.Context, req resourc

state.ID = basetypes.NewStringValue(clusterName)

diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)

if resp.Diagnostics.HasError() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/talos/talos_machine_bootstrap_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (r *talosMachineBootstrapResource) UpgradeState(_ context.Context) map[int6
}

// Set state to fully populated data
diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/talos/talos_machine_configuration_apply_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ func (p *talosMachineConfigurationApplyResource) UpgradeState(_ context.Context)
}

// Set state to fully populated data
diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/talos/talos_machine_configuration_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (d *talosMachineConfigurationDataSource) Read(ctx context.Context, req data
state.MachineConfiguration = basetypes.NewStringValue(machineConfiguration)
state.ID = state.ClusterName

diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)

if resp.Diagnostics.HasError() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/talos/talos_machine_disks_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func (d *talosMachineDisksDataSource) Read(ctx context.Context, req datasource.R

state.ID = basetypes.NewStringValue("machine_disks")

diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)

if resp.Diagnostics.HasError() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/talos/talos_machine_secrets_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func (r *talosMachineSecretsResource) UpgradeState(_ context.Context) map[int64]
}

// Set state to fully populated data
diags = resp.State.Set(ctx, state)
diags = resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
Expand Down Expand Up @@ -632,7 +632,7 @@ func (r *talosMachineSecretsResource) ImportState(ctx context.Context, req resou
}

// Set state to fully populated data
diags := resp.State.Set(ctx, state)
diags := resp.State.Set(ctx, &state)
resp.Diagnostics.Append(diags...)

if resp.Diagnostics.HasError() {
Expand Down