Skip to content

Commit

Permalink
fix: Update workstations for latest reference format
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvigil committed Dec 18, 2024
1 parent 566b758 commit 05e927e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apis/workstations/v1alpha1/config_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/<projectID>/locations/<location>/workstationClusters/<workstationclusterID>/workstationConfigs/<workstationconfigID>)", 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],
Expand Down
2 changes: 1 addition & 1 deletion apis/workstations/v1alpha1/workstation_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/<projectID>/locations/<location>/workstationClusters/<workstationclusterID>/workstationConfigs/<workstationconfigID>/workstations/<workstationID>)", 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],
Expand Down
2 changes: 1 addition & 1 deletion apis/workstations/v1beta1/config_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/<projectID>/locations/<location>/workstationClusters/<workstationclusterID>/workstationConfigs/<workstationconfigID>)", 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],
Expand Down
2 changes: 1 addition & 1 deletion apis/workstations/v1beta1/config_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/<projectID>/locations/<location>/workstationClusters/<workstationclusterID>/workstationConfigs/<workstationconfigID>".
// Should be in the format "projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}/workstationConfigs/{{workstationconfigID}}".
External string `json:"external,omitempty"`

// The name of a WorkstationConfig resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ spec:
properties:
external:
description: A reference to an externally managed WorkstationCluster
resource. Should be in the format "projects/<projectID>/locations/<location>/workstationClusters/<workstationclusterID>".
resource. Should be in the format "projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}".
type: string
name:
description: The name of a WorkstationCluster resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ runningTimeout: string
</td>
<td>
<p><code class="apitype">string</code></p>
<p>{% verbatim %}A reference to an externally managed WorkstationCluster resource. Should be in the format "projects/<projectID>/locations/<location>/workstationClusters/<workstationclusterID>".{% endverbatim %}</p>
<p>{% verbatim %}A reference to an externally managed WorkstationCluster resource. Should be in the format "projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}".{% endverbatim %}</p>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 05e927e

Please sign in to comment.