Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Make PowerOff configurable when using vcsim #2692

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
4 changes: 4 additions & 0 deletions test/infrastructure/vcsim/api/v1alpha1/envvar_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ type ClusterEnvVarSpec struct {
// Datastore specifies the Datastore for the Cluster API cluster.
// Default: 0 (LocalDS_0)
Datastore *int32 `json:"datastore,omitempty"`

// The PowerOffMode for the machines in the cluster.
// Default: trySoft
PowerOffMode *string `json:"powerOffMode,omitempty"`
}

// EnvVarStatus defines the observed state of the EnvVar.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ spec:
name:
description: The name of the Cluster API cluster.
type: string
powerOffMode:
description: 'The PowerOffMode for the machines in the cluster.
Default: trySoft'
type: string
workerMachines:
description: 'The number of the worker machines in the Cluster
API cluster. NOTE: This variable isn''t related to the vcsim
Expand Down
2 changes: 1 addition & 1 deletion test/infrastructure/vcsim/controllers/envvar_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (r *EnvVarReconciler) reconcileNormal(ctx context.Context, envVar *vcsimv1.
// Variables used only in supervisor mode
envVar.Status.Variables["VSPHERE_STORAGE_POLICY"] = "vcsim-default"
envVar.Status.Variables["VSPHERE_MACHINE_CLASS_NAME"] = "best-effort-2xlarge"
envVar.Status.Variables["VSPHERE_POWER_OFF_MODE"] = "trySoft"
envVar.Status.Variables["VSPHERE_POWER_OFF_MODE"] = ptr.Deref(envVar.Spec.Cluster.PowerOffMode, "trySoft")
envVar.Status.Variables["VSPHERE_IMAGE_NAME"] = "test-image-ovf"
envVar.Status.Variables["VSPHERE_STORAGE_CLASS"] = "vcsim-default"
return nil
Expand Down
Loading