Skip to content

Commit

Permalink
fix for build bypass
Browse files Browse the repository at this point in the history
Signed-off-by: James Nesbitt <[email protected]>
  • Loading branch information
james-nesbitt committed Dec 11, 2023
1 parent 7abe7db commit 6ec94eb
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions internal/provider/k0s_config_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,19 @@ func (r *K0sctlConfigResource) Create(ctx context.Context, req resource.CreateRe
RestoreFrom: kcsm.RestoreFrom.ValueString(),
}

kcsm.KubeYaml = types.StringNull()
kcsm.KubeHost = types.StringNull()
kcsm.CaCert = types.StringNull()
kcsm.PrivateKey = types.StringNull()
kcsm.ClientCert = types.StringNull()
kcsm.Id = kcsm.Metadata.Name

if kcsm.SkipCreate.ValueBool() {
resp.Diagnostics.AddWarning("skipping create", "Skipping the k0sctl create because of configuration flag.")
resp.Diagnostics.Append(resp.State.Set(ctx, kcsm)...)
} else if r.testingMode {
resp.Diagnostics.AddWarning("testing mode warning", "k0sctl config resource handler is in testing mode, no installation will be run.")

kcsm.KubeYaml = types.StringNull()
kcsm.KubeHost = types.StringNull()
kcsm.CaCert = types.StringNull()
kcsm.PrivateKey = types.StringNull()
kcsm.ClientCert = types.StringNull()

kcsm.Id = kcsm.Metadata.Name

if diags := resp.State.Set(ctx, kcsm); diags != nil {
resp.Diagnostics.Append(diags...)
}
resp.Diagnostics.Append(resp.State.Set(ctx, kcsm)...)
} else if err := aa.Run(); err != nil {
resp.Diagnostics.Append(diag.NewErrorDiagnostic("error running k0sctl apply", err.Error()))
} else {
Expand Down

0 comments on commit 6ec94eb

Please sign in to comment.