From 05e927ee6b17f84bdf89ac630ec4c2016dfae8bb Mon Sep 17 00:00:00 2001 From: Jason Vigil Date: Wed, 18 Dec 2024 22:39:39 +0000 Subject: [PATCH] fix: Update workstations for latest reference format --- apis/workstations/v1alpha1/config_identity.go | 2 +- apis/workstations/v1alpha1/workstation_identity.go | 2 +- apis/workstations/v1beta1/config_identity.go | 2 +- apis/workstations/v1beta1/config_reference.go | 2 +- ...n_workstationconfigs.workstations.cnrm.cloud.google.com.yaml | 2 +- .../generated/resource-docs/workstations/workstationconfig.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apis/workstations/v1alpha1/config_identity.go b/apis/workstations/v1alpha1/config_identity.go index 7ea038fd91..198360da2e 100644 --- a/apis/workstations/v1alpha1/config_identity.go +++ b/apis/workstations/v1alpha1/config_identity.go @@ -119,7 +119,7 @@ func NewWorkstationConfigIdentity(ctx context.Context, reader client.Reader, obj func ParseWorkstationConfigExternal(external string) (parent *WorkstationConfigParent, resourceID string, err error) { tokens := strings.Split(external, "/") if len(tokens) != 8 || tokens[0] != "projects" || tokens[2] != "locations" || tokens[4] != "workstationClusters" || tokens[6] != "workstationConfigs" { - return nil, "", fmt.Errorf("format of Workstation external=%q was not known (use projects//locations//workstationClusters//workstationConfigs/)", external) + return nil, "", fmt.Errorf("format of Workstation external=%q was not known (use projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}/workstationConfigs/{{workstationconfigID}})", external) } parent = &WorkstationConfigParent{ ProjectID: tokens[1], diff --git a/apis/workstations/v1alpha1/workstation_identity.go b/apis/workstations/v1alpha1/workstation_identity.go index 16cb819ce7..5415656cea 100644 --- a/apis/workstations/v1alpha1/workstation_identity.go +++ b/apis/workstations/v1alpha1/workstation_identity.go @@ -128,7 +128,7 @@ func NewWorkstationIdentity(ctx context.Context, reader client.Reader, obj *Work func ParseWorkstationExternal(external string) (parent *WorkstationParent, resourceID string, err error) { tokens := strings.Split(external, "/") if len(tokens) != 10 || tokens[0] != "projects" || tokens[2] != "locations" || tokens[4] != "workstationClusters" || tokens[6] != "workstationConfigs" || tokens[8] != "workstations" { - return nil, "", fmt.Errorf("format of Workstation external=%q was not known (use projects//locations//workstationClusters//workstationConfigs//workstations/)", external) + return nil, "", fmt.Errorf("format of Workstation external=%q was not known (use projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}/workstationConfigs/{{workstationconfigID}}/workstations/{{workstationID}})", external) } parent = &WorkstationParent{ ProjectID: tokens[1], diff --git a/apis/workstations/v1beta1/config_identity.go b/apis/workstations/v1beta1/config_identity.go index 591cd6c031..dbda18ac11 100644 --- a/apis/workstations/v1beta1/config_identity.go +++ b/apis/workstations/v1beta1/config_identity.go @@ -120,7 +120,7 @@ func NewWorkstationConfigIdentity(ctx context.Context, reader client.Reader, obj func ParseWorkstationConfigExternal(external string) (parent *WorkstationConfigParent, resourceID string, err error) { tokens := strings.Split(external, "/") if len(tokens) != 8 || tokens[0] != "projects" || tokens[2] != "locations" || tokens[4] != "workstationClusters" || tokens[6] != "workstationConfigs" { - return nil, "", fmt.Errorf("format of Workstation external=%q was not known (use projects//locations//workstationClusters//workstationConfigs/)", external) + return nil, "", fmt.Errorf("format of Workstation external=%q was not known (use projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}/workstationConfigs/{{workstationconfigID}})", external) } parent = &WorkstationConfigParent{ ProjectID: tokens[1], diff --git a/apis/workstations/v1beta1/config_reference.go b/apis/workstations/v1beta1/config_reference.go index c6e2f925d6..f1ca966d9f 100644 --- a/apis/workstations/v1beta1/config_reference.go +++ b/apis/workstations/v1beta1/config_reference.go @@ -32,7 +32,7 @@ var _ refsv1beta1.ExternalNormalizer = &WorkstationConfigRef{} // holds the GCP identifier for the KRM object. type WorkstationConfigRef struct { // A reference to an externally managed WorkstationConfig resource. - // Should be in the format "projects//locations//workstationClusters//workstationConfigs/". + // Should be in the format "projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}/workstationConfigs/{{workstationconfigID}}". External string `json:"external,omitempty"` // The name of a WorkstationConfig resource. diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_workstationconfigs.workstations.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_workstationconfigs.workstations.cnrm.cloud.google.com.yaml index 2286f03a7d..9c688483fe 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_workstationconfigs.workstations.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_workstationconfigs.workstations.cnrm.cloud.google.com.yaml @@ -1048,7 +1048,7 @@ spec: properties: external: description: A reference to an externally managed WorkstationCluster - resource. Should be in the format "projects//locations//workstationClusters/". + resource. Should be in the format "projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}". type: string name: description: The name of a WorkstationCluster resource. diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/workstations/workstationconfig.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/workstations/workstationconfig.md index 0fee948b9e..989eb6f1d9 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/workstations/workstationconfig.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/workstations/workstationconfig.md @@ -760,7 +760,7 @@ runningTimeout: string

string

-

{% verbatim %}A reference to an externally managed WorkstationCluster resource. Should be in the format "projects//locations//workstationClusters/".{% endverbatim %}

+

{% verbatim %}A reference to an externally managed WorkstationCluster resource. Should be in the format "projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}".{% endverbatim %}