-
Notifications
You must be signed in to change notification settings - Fork 182
PoC: Fake import to verify KMS integration #1951
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
Conversation
WalkthroughUpdates the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ardaguclu The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
⛔ Files ignored due to path filters (3)
go.sumis excluded by!**/*.sumvendor/github.com/openshift/library-go/pkg/operator/encryption/kms/plugin.gois excluded by!vendor/**,!**/vendor/**vendor/modules.txtis excluded by!vendor/**,!**/vendor/**
📒 Files selected for processing (5)
bindata/bootkube/bootstrap-manifests/kube-apiserver-pod.yaml(1 hunks)go.mod(1 hunks)pkg/operator/starter.go(1 hunks)pkg/operator/targetconfigcontroller/kms_plugin.go(1 hunks)pkg/operator/targetconfigcontroller/targetconfigcontroller.go(7 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- go.mod
🧰 Additional context used
🪛 YAMLlint (1.37.1)
bindata/bootkube/bootstrap-manifests/kube-apiserver-pod.yaml
[warning] 141-141: too many blank lines (1 > 0)
(empty-lines)
🔇 Additional comments (1)
bindata/bootkube/bootstrap-manifests/kube-apiserver-pod.yaml (1)
138-140: Volume definition correctly complements existing mounts.The addition of the
audit-dirhostPath volume is properly structured and aligns with the existing volumeMount references in both the initContainer and main container. The change is appropriate for the audit logging use case.
| - hostPath: | ||
| path: /var/log/kube-apiserver | ||
| name: audit-dir | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing blank line.
The YAML file has an extra blank line at the end of the volumes section that violates linting rules.
Apply this diff to remove the trailing blank line:
- hostPath:
path: /var/log/kube-apiserver
name: audit-dir
-📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - hostPath: | |
| path: /var/log/kube-apiserver | |
| name: audit-dir |
🧰 Tools
🪛 YAMLlint (1.37.1)
[warning] 141-141: too many blank lines (1 > 0)
(empty-lines)
🤖 Prompt for AI Agents
In bindata/bootkube/bootstrap-manifests/kube-apiserver-pod.yaml around line 141,
there is an extra trailing blank line at the end of the volumes section; remove
that blank line so the file ends immediately after the last volume entry (no
extra newline-only line), ensuring the YAML has no blank line violation per
linting rules.
| klog.Infof("KMS encryption enabled with type=%s, region=%s, keyARN=%s", | ||
| apiserver.Spec.Encryption.KMS.Type, | ||
| apiserver.Spec.Encryption.KMS.AWS.Region, | ||
| apiserver.Spec.Encryption.KMS.AWS.KeyARN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against nil AWS KMS config before logging.
apiserver.Spec.Encryption.KMS.AWS is dereferenced unconditionally, so any cluster using a non-AWS KMS provider (or with an incomplete config during rollout) will panic the operator here. Please gate the logging on KMS.AWS != nil (or branch by provider) before touching those fields.
- klog.Infof("KMS encryption enabled with type=%s, region=%s, keyARN=%s",
- apiserver.Spec.Encryption.KMS.Type,
- apiserver.Spec.Encryption.KMS.AWS.Region,
- apiserver.Spec.Encryption.KMS.AWS.KeyARN)
+ klog.Infof("KMS encryption enabled with type=%s", apiserver.Spec.Encryption.KMS.Type)
+ if awsConfig := apiserver.Spec.Encryption.KMS.AWS; awsConfig != nil {
+ klog.Infof("KMS AWS config: region=%s, keyARN=%s", awsConfig.Region, awsConfig.KeyARN)
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| klog.Infof("KMS encryption enabled with type=%s, region=%s, keyARN=%s", | |
| apiserver.Spec.Encryption.KMS.Type, | |
| apiserver.Spec.Encryption.KMS.AWS.Region, | |
| apiserver.Spec.Encryption.KMS.AWS.KeyARN) | |
| klog.Infof("KMS encryption enabled with type=%s", apiserver.Spec.Encryption.KMS.Type) | |
| if awsConfig := apiserver.Spec.Encryption.KMS.AWS; awsConfig != nil { | |
| klog.Infof("KMS AWS config: region=%s, keyARN=%s", awsConfig.Region, awsConfig.KeyARN) | |
| } |
🤖 Prompt for AI Agents
In pkg/operator/targetconfigcontroller/kms_plugin.go around lines 52 to 55, the
code unconditionally dereferences apiserver.Spec.Encryption.KMS.AWS which will
panic if AWS KMS config is nil; update the logging to first check that
apiserver.Spec.Encryption.KMS != nil and apiserver.Spec.Encryption.KMS.AWS !=
nil (or branch by provider) and only include region/keyARN in the message when
AWS config exists, otherwise log a provider-only message or omit AWS fields to
avoid nil dereference.
|
/retest |
|
@ardaguclu: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/close |
|
@ardaguclu: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Fake import to exercise openshift/library-go#2041
/hold