Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 707294a

Browse files
committed
Adding missing Category for Workspace Variable
1 parent 0c0b52b commit 707294a

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ require (
3535
replace (
3636
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
3737
github.com/hashicorp/consul/api => github.com/hashicorp/consul/api v1.11.0
38+
github.com/hashicorp/go-tfe => github.com/jtyr/go-tfe v0.21.0-1
3839
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.277
3940
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.277
4041
k8s.io/client-go => k8s.io/client-go v0.21.4

go.sum

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,11 @@ github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER
357357
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
358358
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
359359
github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I=
360-
github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8=
361360
github.com/hashicorp/go-slug v0.7.0 h1:8HIi6oreWPtnhpYd8lIGQBgp4rXzDWQTOhfILZm+nok=
362361
github.com/hashicorp/go-slug v0.7.0/go.mod h1:Ib+IWBYfEfJGI1ZyXMGNbu2BU+aa3Dzu41RKLH301v4=
363362
github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
364363
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
365364
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
366-
github.com/hashicorp/go-tfe v0.14.0/go.mod h1:B71izbwmCZdhEo/GzHopCXN3P74cYv2tsff1mxY4J6c=
367-
github.com/hashicorp/go-tfe v0.21.0 h1:P1QoeLkigDi4BXGQ//42kyXwfcHUqbh5jJemml6iQJs=
368-
github.com/hashicorp/go-tfe v0.21.0/go.mod h1:gyXLXbpBVxA2F/6opah8XBsOkZJxHYQmghl0OWi8keI=
369365
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
370366
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
371367
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
@@ -385,7 +381,6 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T
385381
github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90=
386382
github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg=
387383
github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
388-
github.com/hashicorp/jsonapi v0.0.0-20210420151930-edf82c9774bf/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik=
389384
github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d h1:9ARUJJ1VVynB176G1HCwleORqCaXm/Vx0uUi0dL26I0=
390385
github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik=
391386
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
@@ -430,6 +425,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
430425
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
431426
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
432427
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
428+
github.com/jtyr/go-tfe v0.21.0-1 h1:Z9dxxPQfevu/A6l6yA2z6NK4k8AlhEXyhvFFGGELXYg=
429+
github.com/jtyr/go-tfe v0.21.0-1/go.mod h1:gyXLXbpBVxA2F/6opah8XBsOkZJxHYQmghl0OWi8keI=
433430
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
434431
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
435432
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=

vendor/github.com/hashicorp/go-tfe/variable.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ github.com/hashicorp/go-multierror
7272
github.com/hashicorp/go-retryablehttp
7373
# github.com/hashicorp/go-slug v0.7.0
7474
github.com/hashicorp/go-slug
75-
# github.com/hashicorp/go-tfe v0.21.0
75+
# github.com/hashicorp/go-tfe v0.21.0 => github.com/jtyr/go-tfe v0.21.0-1
7676
## explicit
7777
github.com/hashicorp/go-tfe
7878
# github.com/hashicorp/go-version v1.2.1
@@ -646,6 +646,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
646646
sigs.k8s.io/yaml
647647
# github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
648648
# github.com/hashicorp/consul/api => github.com/hashicorp/consul/api v1.11.0
649+
# github.com/hashicorp/go-tfe => github.com/jtyr/go-tfe v0.21.0-1
649650
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.277
650651
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.277
651652
# k8s.io/client-go => k8s.io/client-go v0.21.4

workspacehelper/tfc_variable.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ func checkIfVariableChanged(specVariable *tfc.Variable, workspaceVariable *tfc.V
8282
if specVariable.HCL != workspaceVariable.HCL {
8383
return true
8484
}
85+
if specVariable.Category != workspaceVariable.Category {
86+
return true
87+
}
8588
if !specVariable.Sensitive && workspaceVariable.Sensitive {
8689
return true
8790
}
@@ -212,6 +215,7 @@ func (t *TerraformCloudClient) UpdateTerraformVariables(variables []*tfc.Variabl
212215
Key: &v.Key,
213216
Value: &v.Value,
214217
HCL: &v.HCL,
218+
Category: &v.Category,
215219
Sensitive: &v.Sensitive,
216220
}
217221
_, err := t.Client.Variables.Update(context.TODO(), v.Workspace.ID, v.ID, options)

0 commit comments

Comments
 (0)