Skip to content

Commit

Permalink
chore: default talos_machine_configuration docs and examples to false
Browse files Browse the repository at this point in the history
Generating talos machine configs with docs and examples enabled makes them too large.

Fixes #181

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
hh authored and frezbo committed Aug 5, 2024
1 parent 80c5534 commit d614bcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
9 changes: 0 additions & 9 deletions pkg/talos/talos_machine_configuration_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,6 @@ func (d *talosMachineConfigurationDataSource) Read(ctx context.Context, req data
return
}

// set default values
if !state.Docs.IsUnknown() && state.Docs.IsNull() {
state.Docs = basetypes.NewBoolValue(true)
}

if !state.Examples.IsUnknown() && state.Examples.IsNull() {
state.Examples = basetypes.NewBoolValue(true)
}

if !state.KubernetesVersion.IsUnknown() && state.KubernetesVersion.IsNull() {
state.KubernetesVersion = basetypes.NewStringValue(constants.DefaultKubernetesVersion)
}
Expand Down
14 changes: 9 additions & 5 deletions pkg/talos/talos_machine_configuration_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ func TestAccTalosMachineConfigurationDataSource(t *testing.T) {
constants.DefaultKubernetesVersion,
"controlplane",
value,
true,
false,
true,
func(t *testing.T, config v1alpha1.Config) error {
assert.NotEmpty(t, config.Cluster().AESCBCEncryptionSecret())
assert.Empty(t, config.Cluster().SecretboxEncryptionSecret())
Expand Down Expand Up @@ -351,14 +351,18 @@ func validateGeneratedTalosMachineConfig(
if examples {
// verifying there's examples
assert.Contains(t, mc, (`
# diskSelector:
# size: 4GB # Disk size.
# # Uncomment this to enable SANs.
# - 10.0.0.10
# - 172.16.0.10
# - 192.168.0.10
`))
} else {
// verifying there's no examples
assert.NotContains(t, mc, (`
# diskSelector:
# size: 4GB # Disk size.
# # Uncomment this to enable SANs.
# - 10.0.0.10
# - 172.16.0.10
# - 192.168.0.10
`))
}

Expand Down

0 comments on commit d614bcc

Please sign in to comment.