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

feat: enables CRL configuration #1941

Merged
merged 27 commits into from
Jan 6, 2025
Merged

feat: enables CRL configuration #1941

merged 27 commits into from
Jan 6, 2025

Conversation

junczhu
Copy link
Collaborator

@junczhu junczhu commented Nov 20, 2024

Description

This PR enables CRL configuration which configs the behavior of CRL and CRL fetcher.
Read input from config.json and parse into configuration defined in crl_config.go
To not change any existing interface, the implementation used a global variable to make the configuration accessible for both KMP and Notation Verifier.

What this PR does / why we need it:

  • Enable CRL config input in config.json
  • Update CRL config from CacheEnabled to CacheDisabled to make sure the default value as false
  • Update the Cache config setting in CRL Fetcher creatation

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):

Fixes # 1888

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Helm Chart Change (any edit/addition/update that is necessary for changes merged to the main branch)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • Does the affected code have corresponding tests?
  • Are the changes documented, not just with inline documentation, but also with conceptual documentation such as an overview of a new feature, or task-based documentation like a tutorial? Consider if this change should be announced on your project blog.
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have appropriate license header?

Post Merge Requirements

  • MAINTAINERS: manually trigger the "Publish Package" workflow after merging any PR that indicates Helm Chart Change

@junczhu junczhu changed the title feat: update kmp crds and default templates feat: update crds and default templates Nov 21, 2024
@junczhu
Copy link
Collaborator Author

junczhu commented Nov 22, 2024

cc\ @yizha1 @FeynmanZhou for a heads-up

@junczhu
Copy link
Collaborator Author

junczhu commented Nov 26, 2024

May consider adding the config to the executor as a global variable.
Shall we have cx update the CRL related configuration in CR dynamically? @yizha1

@junczhu junczhu changed the title feat: update crds and default templates feat: update default templates for CRL config Dec 2, 2024
@junczhu
Copy link
Collaborator Author

junczhu commented Dec 2, 2024

As discussed, the configuration would be coming with the ratify config

@junczhu junczhu changed the base branch from crl to dev December 16, 2024 23:39
@junczhu
Copy link
Collaborator Author

junczhu commented Dec 16, 2024

Looking into DCO check

@susanshi
Copy link
Collaborator

this PR is still targeting v1.4 , please tag maintainers for review once this is ready. thanks !

Signed-off-by: Juncheng Zhu <[email protected]>
@junczhu
Copy link
Collaborator Author

junczhu commented Dec 18, 2024

DCO check resolved, Adding tests.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
config/configManager.go 0.00% 1 Missing ⚠️
pkg/manager/manager.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
cmd/ratify/cmd/verify.go 74.32% <100.00%> (+0.71%) ⬆️
config/config.go 50.00% <ø> (ø)
pkg/keymanagementprovider/refresh/kubeRefresh.go 100.00% <100.00%> (ø)
pkg/verifier/notation/notation.go 98.06% <100.00%> (+0.01%) ⬆️
pkg/verifier/notation/notationrevocationfactory.go 81.25% <100.00%> (+7.33%) ⬆️
pkg/verifier/notation/revocationfactory.go 86.36% <100.00%> (ø)
config/configManager.go 0.00% <0.00%> (ø)
pkg/manager/manager.go 3.06% <0.00%> (-0.04%) ⬇️

... and 3 files with indirect coverage changes

@junczhu junczhu marked this pull request as ready for review December 23, 2024 07:56
@junczhu junczhu changed the title feat: update default templates for CRL config feat: enables CRL configuration Dec 23, 2024
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
@junczhu junczhu marked this pull request as draft January 2, 2025 22:28
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
@junczhu junczhu marked this pull request as ready for review January 3, 2025 07:56
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
test/bats/cli-test.bats Outdated Show resolved Hide resolved
test/bats/cli-test.bats Show resolved Hide resolved
config/crl_config.go Outdated Show resolved Hide resolved
config/configManager.go Show resolved Hide resolved
pkg/verifier/notation/notationrevocationfactory.go Outdated Show resolved Hide resolved
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Copy link
Collaborator

@binbin-li binbin-li left a comment

Choose a reason for hiding this comment

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

lgtm overall, some minor comments

test/bats/cli-test.bats Outdated Show resolved Hide resolved
config/crl_config.go Outdated Show resolved Hide resolved
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
@binbin-li binbin-li merged commit f04f768 into ratify-project:dev Jan 6, 2025
19 of 20 checks passed
@junczhu junczhu deleted the CRDs branch January 13, 2025 08:51
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.

3 participants