Skip to content

resolve version conflicts with local chart#1176

Merged
BBBmau merged 25 commits intomainfrom
local-chart-verion
Aug 24, 2023
Merged

resolve version conflicts with local chart#1176
BBBmau merged 25 commits intomainfrom
local-chart-verion

Conversation

@BBBmau
Copy link
Collaborator

@BBBmau BBBmau commented Jul 7, 2023

Description

This PR checks the repository value to see whether it's a path or a URL. This would prevent conflicts with the version attribute since the expected action is to have the version attribute match the chart version if done locally.

Having a local chart will prevent the use of the version attribute so that no diff is shown.

Fixes #1157

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
 mau@mau-JKDT676NCP  ~/Dev/terraform-provider-helm   local-chart-verion ● ⍟2  make testacc TESTARGS="-run TestAccResourceRelease_LocalVersion"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test "./helm" -v -run TestAccResourceRelease_LocalVersion -timeout 10m
2023/07/27 09:55:23 Building chart repository...
2023/07/27 09:55:23 Created repository package for "broken-chart"
2023/07/27 09:55:23 Created repository package for "crds-chart"
2023/07/27 09:55:23 Created repository package for "dependency-bar"
2023/07/27 09:55:23 Created repository package for "dependency-foo"
2023/07/27 09:55:23 Created repository package for "failed-deploy"
2023/07/27 09:55:24 Created repository package for "kube-version"
2023/07/27 09:55:24 Created repository package for "test-chart"
2023/07/27 09:55:24 Created repository package for "test-chart-v2"
2023/07/27 09:55:24 Created repository package for "umbrella-chart"
2023/07/27 09:55:24 Built chart repository index
2023/07/27 09:55:24 Test repository is listening on http://localhost:55557
=== RUN   TestAccResourceRelease_LocalVersion
--- PASS: TestAccResourceRelease_LocalVersion (9.16s)
PASS
ok      github.com/hashicorp/terraform-provider-helm/helm       10.609s
 mau@mau-JKDT676NCP  ~/Dev/terraform-provider-helm   local-chart-verion ⍟3  make testacc TESTARGS="-run TestUseChartVersion"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test "./helm" -v -run TestUseChartVersion -timeout 10m
2023/08/03 11:54:11 Building chart repository...
2023/08/03 11:54:11 Created repository package for "broken-chart"
2023/08/03 11:54:11 Created repository package for "crds-chart"
2023/08/03 11:54:11 Created repository package for "dependency-bar"
2023/08/03 11:54:11 Created repository package for "dependency-foo"
2023/08/03 11:54:11 Created repository package for "failed-deploy"
2023/08/03 11:54:11 Created repository package for "kube-version"
2023/08/03 11:54:11 Created repository package for "test-chart"
2023/08/03 11:54:11 Created repository package for "test-chart-v2"
2023/08/03 11:54:11 Created repository package for "umbrella-chart"
2023/08/03 11:54:12 Built chart repository index
2023/08/03 11:54:12 Test repository is listening on http://localhost:56084
=== RUN   TestUseChartVersion
--- PASS: TestUseChartVersion (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-helm/helm     1.113s

Release Note

Release note for CHANGELOG:

`helm/resource_release.go`: Fix: version conflicts when using local chart 

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@BBBmau BBBmau requested a review from a team as a code owner July 7, 2023 20:02
@BBBmau BBBmau changed the title add url checker to resolve version conflicts with local chart resolve version conflicts with local chart Jul 27, 2023
@github-actions github-actions bot added size/M and removed size/S labels Jul 27, 2023
@tstraley
Copy link

Does this work for cases of soft version pinning (eg. ~1.47.0) in the helm_release?

@BBBmau
Copy link
Collaborator Author

BBBmau commented Jul 28, 2023

Does this work for cases of soft version pinning (eg. ~1.47.0) in the helm_release?

Thank you for mentioning this case @tstraley, yes it will work with soft version pinning. It will still ignore whatever version attribute is set assuming you are not getting a chart from a repo.

@BBBmau BBBmau requested a review from jrhouston August 3, 2023 18:50
@BBBmau BBBmau requested a review from alexsomesan August 9, 2023 12:57
Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Might need approval from @jrhouston because he had a "request changes" comment.

@BBBmau BBBmau requested a review from jrhouston August 24, 2023 17:34
@BBBmau BBBmau merged commit 037da15 into main Aug 24, 2023
@BBBmau BBBmau deleted the local-chart-verion branch August 24, 2023 18:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version conflicts between terraform and chart

4 participants