Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround helm template bug when testing for APIVersions #1533

Merged
merged 3 commits into from
Sep 8, 2021

Conversation

sathieu
Copy link
Contributor

@sathieu sathieu commented Sep 7, 2021

What this PR does / why we need it:

#1502 broke gatekeeper installation with ArgoCD.

The reason is ArgoCD is using helm template command, passing all supported APIVersions, but Helm pre-fill this with the supported versions of the Kubernetes used during helm build (i.e. k8s 1.21).

There are a few related bug reports like in argoproj/argo-cd#6351, argoproj/argo-cd#3594.

This PR change the behavior to match on exact resource type, as Helm is not pre-filling those.

Other possible workarounds include:

Side node:
The behavior of helm template should also be fixed when --api-version is passed.

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2021

Codecov Report

Merging #1533 (140a003) into master (63b51d3) will decrease coverage by 0.10%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1533      +/-   ##
==========================================
- Coverage   53.35%   53.25%   -0.11%     
==========================================
  Files          84       84              
  Lines        7547     7547              
==========================================
- Hits         4027     4019       -8     
- Misses       3163     3168       +5     
- Partials      357      360       +3     
Flag Coverage Δ
unittests 53.25% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 51.67% <0.00%> (-2.88%) ⬇️
pkg/watch/replay.go 81.25% <0.00%> (+2.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63b51d3...140a003. Read the comment docs.

@sathieu sathieu force-pushed the workaround_helm_template branch 2 times, most recently from 5c8ca7b to 5f7f16d Compare September 7, 2021 11:51
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Copy link

@koozz koozz left a comment

Choose a reason for hiding this comment

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

This fixed it for my installation to a Kubernetes 1.20 cluster.

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

@ritazh ritazh merged commit c91112c into open-policy-agent:master Sep 8, 2021
@sathieu sathieu deleted the workaround_helm_template branch September 8, 2021 16:25
@sathieu
Copy link
Contributor Author

sathieu commented Sep 24, 2021

for reference, the whole picture is at argoproj/argo-cd#7291.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants