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

fix: kubernetes and kyverno version annotations in kyverno-policies helm chart (#1165) #11258

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sergey198828
Copy link

@sergey198828 sergey198828 commented Sep 27, 2024

Explanation

When deploy kyverno-policies helm chart it specifies versions as annotations of each policy:

  • kyverno.io/kyverno-version: Automatically detects installed version of kyverno. If version couldn't be detected value taken from Chart.yaml AppVersion field.
  • kyverno.io/kubernetes-version: Takes from values.yaml for which new key been added there.

Related issue

/closes kyverno/policies#1165
@realshuting

Milestone of this PR

/milestone release-1.13

Documentation (required for features)

My PR does not contain any new functionalities to Kyverno. Documentation for helm chart been updated in README.md and comments been added to values.yaml

What type of PR is this

/kind bug

Proposed Changes

This change maintain appropriate annotations to Kubernetes resources when deploy policy using kyverno-policies helm chart. It gives users control to which versions of Kubernetes policies suppose to run and which not.

Proof Manifests

Not applicable since no change to Kyverno itself been made, only to helm chart.

Before change

helm template kyverno-policies ./charts/kyverno-policies | grep kubernetes-version
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"
    kyverno.io/kubernetes-version: "1.22-1.23"

helm template kyverno-policies ./charts/kyverno-policies | grep kyverno-version   
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0
    kyverno.io/kyverno-version: 1.6.0

After change

helm template kyverno-policies ./charts/kyverno-policies | grep kubernetes-version
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30
    kyverno.io/kubernetes-version: 1.28-1.30

helm template kyverno-policies ./charts/kyverno-policies | grep kyverno-version
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1
    kyverno.io/kyverno-version: v1.13.0-rc.1

Checklist

  • [ x ] I have read the contributing guidelines.
  • [ x ] I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • This is a bug fix and I have added unit tests that prove my fix is effective.
  • This is a feature and I have added CLI tests that are applicable.
  • My PR needs to be cherry picked to a specific release branch which is .
  • My PR contains new or altered behavior to Kyverno and
  • CLI support should be added and my PR doesn't contain that functionality.

Copy link

welcome bot commented Sep 27, 2024

Thanks for opening your first Pull Request here! Please check out our Contributing guidelines and confirm that you Signed off.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 27, 2024
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 12.39%. Comparing base (12edb6d) to head (73c348a).
Report is 133 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11258      +/-   ##
==========================================
+ Coverage   12.22%   12.39%   +0.17%     
==========================================
  Files         946      949       +3     
  Lines       87341    88045     +704     
==========================================
+ Hits        10676    10916     +240     
- Misses      75355    75783     +428     
- Partials     1310     1346      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergey198828 sergey198828 force-pushed the fix-policies-issues-1165 branch 3 times, most recently from 8e9b52b to 1a17159 Compare October 3, 2024 08:41
@realshuting realshuting changed the base branch from release-1.13 to main October 14, 2024 11:10
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 14, 2024
@realshuting realshuting changed the base branch from main to release-1.13 October 14, 2024 11:11
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Oct 14, 2024
@realshuting
Copy link
Member

Hi @sergey198828 - can you send the PR to main branch instead of release-1.13? We merge all PRs to main first then cherry-pick to release branches if needed.

@realshuting realshuting self-assigned this Oct 14, 2024
@sergey198828 sergey198828 changed the base branch from release-1.13 to main October 14, 2024 11:19
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 14, 2024
…elm chart match release and supported versions (kyverno#1165)

Signed-off-by: kiyanser <[email protected]>
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Oct 15, 2024
@sergey198828
Copy link
Author

Hi @sergey198828 - can you send the PR to main branch instead of release-1.13? We merge all PRs to main first then cherry-pick to release branches if needed.

@realshuting PR been sent to main instead of release-1.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
milestone 1.14.0 size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Kyverno-policies helm chart has hardcoded Kubernetes version annotations
2 participants