8000 feat: Removing old schema by kushal9897 · Pull Request #12840 · kyverno/kyverno · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Removing old schema #12840

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

kushal9897
Copy link
Contributor
@kushal9897 kushal9897 commented Apr 20, 2025

Explanation

This PR removes support for the deprecated Kyverno CLI test schema, which did not include apiVersion and kind. From now on, test cases must follow the new schema format (apiVersion: cli.kyverno.io/v1alpha1, kind: Test).

This change improves schema validation consistency and ensures a single test format moving forward.

Related issue

#8928

Milestone of this PR

/milestone 1.15.0

Documentation (required for features)

My PR contains new or altered behavior to Kyverno.

What type of PR is this

/kind cleanup
/kind feature

Proposed Changes

Proof Manifests

Checklist

  • [*] I have read the contributing guidelines.
  • [*] 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.

Further Comments

Signed-off-by: kushal9897 <kushalag2580@gmail.com>
@kushal9897 kushal9897 marked this pull request as ready for review April 20, 2025 20:34
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 20, 2025
Copy link
codecov bot commented Apr 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 15.32%. Comparing base (963dfd6) to head (5fc2246).

Files with missing lines Patch % Lines
cmd/cli/kubectl-kyverno/test/load.go 0.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12840      +/-   ##
==========================================
- Coverage   15.33%   15.32%   -0.01%     
==========================================
  Files         923      923              
  Lines      100275   100282       +7     
==========================================
- Hits        15374    15369       -5     
- Misses      83189    83199      +10     
- Partials     1712     1714       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kushal9897
Copy link
Contributor Author

Release 1.11

fmt.Fprintf(out, "\nWARNING: test file (%s) uses a deprecated schema that will be removed in 1.13\n", path)

Release 1.12

fmt.Fprintf(out, "\nWARNING: test file (%s) uses a deprecated schema that will be removed in 1.13\n", path)

Release 1.13

fmt.Fprintf(out, "\nWARNING: values file (%s) uses a deprecated schema that will be removed in 1.13\n", path)

Release 1.14

fmt.Fprintf(out, "\nWARNING: test file (%s) uses a deprecated schema that will be removed in 1.14\n", path)

@kushal9897
Copy link
Contributor Author

Hello @MariamFahmy98 , we also want to correct the warning message for the release 1.14. Right now, it shows WARNING: test file (%s) uses a deprecated schema that will be removed in 1.14, but the correct one WARNING: test file (%s) uses a deprecated schema that will be removed in 1.15

Copy link
Contributor
@MariamFahmy98 MariamFahmy98 left a comment

Choose a reason for hiding this comment

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

We have to remove the old approach for userInfo and value as well. You can find here all the functions that check deprecations for the test command.

IMO we should check the returned value from these functions and if they detect a deprecation being used in the test, the command should fail with an error, preventing the test from running with outdated syntax.

For example, the following code is used to check if there are any deprecations used for the values file:

deprecations.CheckValues(out, path, v)

I would check the returned value, and if it is true, I will return an error and this should prevent the test from running.

cc @eddycharly

kushal9897 and others added 2 commits May 9, 2025 05:21
@kushal9897 kushal9897 requested a review from MariamFahmy98 May 9, 2025 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
milestone 1.15.0 size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0