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

Commit

Permalink
Adding missing Category for Workspace Variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jtyr committed May 11, 2022
1 parent 0c0b52b commit 707294a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
7 changes: 7 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ require (
replace (
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
github.com/hashicorp/consul/api => github.com/hashicorp/consul/api v1.11.0
github.com/hashicorp/go-tfe => github.com/jtyr/go-tfe v0.21.0-1
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.277
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.277
k8s.io/client-go => k8s.io/client-go v0.21.4
Expand Down
7 changes: 2 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,11 @@ github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I=
github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8=
github.com/hashicorp/go-slug v0.7.0 h1:8HIi6oreWPtnhpYd8lIGQBgp4rXzDWQTOhfILZm+nok=
github.com/hashicorp/go-slug v0.7.0/go.mod h1:Ib+IWBYfEfJGI1ZyXMGNbu2BU+aa3Dzu41RKLH301v4=
github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-tfe v0.14.0/go.mod h1:B71izbwmCZdhEo/GzHopCXN3P74cYv2tsff1mxY4J6c=
github.com/hashicorp/go-tfe v0.21.0 h1:P1QoeLkigDi4BXGQ//42kyXwfcHUqbh5jJemml6iQJs=
github.com/hashicorp/go-tfe v0.21.0/go.mod h1:gyXLXbpBVxA2F/6opah8XBsOkZJxHYQmghl0OWi8keI=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
Expand All @@ -385,7 +381,6 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T
github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90=
github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg=
github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
github.com/hashicorp/jsonapi v0.0.0-20210420151930-edf82c9774bf/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik=
github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d h1:9ARUJJ1VVynB176G1HCwleORqCaXm/Vx0uUi0dL26I0=
github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
Expand Down Expand Up @@ -430,6 +425,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/jtyr/go-tfe v0.21.0-1 h1:Z9dxxPQfevu/A6l6yA2z6NK4k8AlhEXyhvFFGGELXYg=
github.com/jtyr/go-tfe v0.21.0-1/go.mod h1:gyXLXbpBVxA2F/6opah8XBsOkZJxHYQmghl0OWi8keI=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/hashicorp/go-tfe/variable.go

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

3 changes: 2 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ github.com/hashicorp/go-multierror
github.com/hashicorp/go-retryablehttp
# github.com/hashicorp/go-slug v0.7.0
github.com/hashicorp/go-slug
# github.com/hashicorp/go-tfe v0.21.0
# github.com/hashicorp/go-tfe v0.21.0 => github.com/jtyr/go-tfe v0.21.0-1
## explicit
github.com/hashicorp/go-tfe
# github.com/hashicorp/go-version v1.2.1
Expand Down Expand Up @@ -646,6 +646,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
sigs.k8s.io/yaml
# github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
# github.com/hashicorp/consul/api => github.com/hashicorp/consul/api v1.11.0
# github.com/hashicorp/go-tfe => github.com/jtyr/go-tfe v0.21.0-1
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.277
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag => github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.277
# k8s.io/client-go => k8s.io/client-go v0.21.4
4 changes: 4 additions & 0 deletions workspacehelper/tfc_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func checkIfVariableChanged(specVariable *tfc.Variable, workspaceVariable *tfc.V
if specVariable.HCL != workspaceVariable.HCL {
return true
}
if specVariable.Category != workspaceVariable.Category {
return true
}
if !specVariable.Sensitive && workspaceVariable.Sensitive {
return true
}
Expand Down Expand Up @@ -212,6 +215,7 @@ func (t *TerraformCloudClient) UpdateTerraformVariables(variables []*tfc.Variabl
Key: &v.Key,
Value: &v.Value,
HCL: &v.HCL,
Category: &v.Category,
Sensitive: &v.Sensitive,
}
_, err := t.Client.Variables.Update(context.TODO(), v.Workspace.ID, v.ID, options)
Expand Down

0 comments on commit 707294a

Please sign in to comment.