@@ -447,6 +447,24 @@ type WorkspaceProject struct {
447447 Name string `json:"name,omitempty"`
448448}
449449
450+ type WorkspaceVariableSet struct {
451+ // ID of the variable set.
452+ // Must match pattern: `varset-[a-zA-Z0-9]+$`
453+ // More information:
454+ // - https://developer.hashicorp.com/terraform/tutorials/cloud/cloud-multiple-variable-sets
455+ //
456+ //+kubebuilder:validation:Pattern:="varset-[a-zA-Z0-9]+$"
457+ //+optional
458+ ID string `json:"id,omitempty"`
459+ // Name of the variable set.
460+ // More information:
461+ // - https://developer.hashicorp.com/terraform/tutorials/cloud/cloud-multiple-variable-sets
462+ //
463+ //+kubebuilder:validation:MinLength:=1
464+ //+optional
465+ Name string `json:"name,omitempty"`
466+ }
467+
450468// WorkspaceSpec defines the desired state of Workspace.
451469type WorkspaceSpec struct {
452470 // Workspace name.
@@ -726,9 +744,15 @@ type WorkspaceStatus struct {
726744 VariableSets []VariableSetStatus `json:"variableSet,omitempty"`
727745}
728746
747+ type VariableSetStatus struct {
748+ ID string `json:"id,omitempty"`
749+ Name string `json:"name,omitempty"`
750+ }
751+
729752//+kubebuilder:object:root=true
730753//+kubebuilder:subresource:status
731754//+kubebuilder:printcolumn:name="Workspace ID",type=string,JSONPath=`.status.workspaceID`
755+ //+kubebuilder:metadata:labels="app.terraform.io/crd-schema-version=v25.4.0"
732756
733757// Workspace manages HCP Terraform Workspaces.
734758// More information:
@@ -750,29 +774,6 @@ type WorkspaceList struct {
750774 Items []Workspace `json:"items"`
751775}
752776
753- type WorkspaceVariableSet struct {
754- // ID of the variable set.
755- // Must match pattern: `varset-[a-zA-Z0-9]+$`
756- // More information:
757- // - https://developer.hashicorp.com/terraform/tutorials/cloud/cloud-multiple-variable-sets
758- //
759- //+kubebuilder:validation:Pattern:="varset-[a-zA-Z0-9]+$"
760- //+optional
761- ID string `json:"id,omitempty"`
762- // Name of the variable set.
763- // More information:
764- // - https://developer.hashicorp.com/terraform/tutorials/cloud/cloud-multiple-variable-sets
765- //
766- //+kubebuilder:validation:MinLength:=1
767- //+optional
768- Name string `json:"name,omitempty"`
769- }
770-
771- type VariableSetStatus struct {
772- ID string `json:"id,omitempty"`
773- Name string `json:"name,omitempty"`
774- }
775-
776777func init () {
777778 SchemeBuilder .Register (& Workspace {}, & WorkspaceList {})
778779}
0 commit comments