[WIP]Adding KMS TestKMSEncryptionOnOff test#2018
[WIP]Adding KMS TestKMSEncryptionOnOff test#2018gangwgr wants to merge 2 commits intoopenshift:mainfrom
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gangwgr The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
8a2c3d1 to
304c290
Compare
go.mod
Outdated
| github.com/miekg/dns v1.1.61 | ||
| github.com/onsi/ginkgo/v2 v2.21.0 | ||
| github.com/openshift-eng/openshift-tests-extension v0.0.0-20250804142706-7b3ab438a292 | ||
| github.com/openshift/api v0.0.0-20251111013132-5c461e21bdb7 |
There was a problem hiding this comment.
please move "vendor" changes to a separate PR.
| t.Log("KMS encryption on/off test placeholder - CI job validation") | ||
| ctx := context.Background() | ||
|
|
||
| // Get clients for deploying KMS plugin |
| // Get clients for deploying KMS plugin | ||
| clientSet := library.GetClients(t) | ||
|
|
||
| // Step 1: Deploy the mock KMS plugin |
| clientSet := library.GetClients(t) | ||
|
|
||
| // Step 1: Deploy the mock KMS plugin | ||
| t.Log("Deploying mock KMS plugin...") |
There was a problem hiding this comment.
rm this log - we added logs to the deployer.
|
|
||
| // Step 1: Deploy the mock KMS plugin | ||
| t.Log("Deploying mock KMS plugin...") | ||
| cleanup := kms.DeployUpstreamMockKMSPlugin( |
There was a problem hiding this comment.
this could be changed to:
t.Cleanup(kms.DeployUpstreamMockKMSPlugin(...))
| ) | ||
| defer cleanup() | ||
|
|
||
| // Step 2-10: Run the encryption on/off test |
304c290 to
ea1327b
Compare
| defer cleanup() | ||
|
|
||
| // Step 2-10: Run the encryption on/off test | ||
| t.Log("Running KMS encryption on/off test...") |
There was a problem hiding this comment.
do we need these logs ?
4820d14 to
db52c11
Compare
|
Better to wait #2015 to be merged. |
| t.Cleanup(kms.DeployUpstreamMockKMSPlugin( | ||
| ctx, | ||
| t, | ||
| clientSet.Kube, |
There was a problem hiding this comment.
could we library.GetClients(t).Kube ?
| "github.com/openshift/cluster-kube-apiserver-operator/pkg/operator/operatorclient" | ||
| operatorencryption "github.com/openshift/cluster-kube-apiserver-operator/test/library/encryption" | ||
| library "github.com/openshift/library-go/test/library/encryption" | ||
| "github.com/openshift/library-go/test/library/encryption/kms" |
| // Get clients for deploying KMS plugin | ||
| clientSet := library.GetClients(t) | ||
|
|
||
| t.Cleanup(kms.DeployUpstreamMockKMSPlugin( |
There was a problem hiding this comment.
nit: could you make a one liner instead ?
db52c11 to
5c80e90
Compare
|
we must also pull openshift/library-go#2086 in |
bc16b88 to
75d17e3
Compare
| if err := encryptionkms.AddKMSPluginVolumeAndMountToPodSpec(&required.Spec, "kube-apiserver", featureGateAccessor); err != nil { | ||
| return nil, false, fmt.Errorf("failed to add KMS encryption volumes: %w", err) | ||
| // Add KMS plugin volume mount if the KMS encryption feature gate is enabled | ||
| if err := kms.AddKMSPluginVolumeAndMountToPodSpec(&required.Spec, "kube-apiserver", featureGateAccessor); err != nil { |
There was a problem hiding this comment.
We don't need these changes as well, master branch should include them already.
75d17e3 to
7f0e519
Compare
go.sum
Outdated
| github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= | ||
| github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= | ||
| github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= | ||
| github.com/gangwgr/library-go v0.0.0-20260129150807-18fba7769367 h1:dz9NGDpWK+clJaUfXP94lG5okB38qppI6lnqB/rSe0s= |
There was a problem hiding this comment.
I don't see the changes in openshift/library-go#2086
7f0e519 to
f588d0c
Compare
|
/testwith gangwgr/cluster-kube-apiserver-operator/kms-e2e-full-test openshift/cluster-openshift-apiserver-operator#643 |
|
@ardaguclu, |
|
/testwith openshift/cluster-kube-apiserver-operator/main/e2e-gcp-operator-encryption-kms openshift/cluster-openshift-apiserver-operator#643 |
|
/testwith abort |
|
To sum up, once we sort out the KMS plugin issue, we can run this command; |
f588d0c to
8633746
Compare
|
/testwith openshift/cluster-kube-apiserver-operator/main/e2e-gcp-operator-encryption-kms openshift/cluster-openshift-apiserver-operator#643 openshift/cluster-authentication-operator#832 |
8633746 to
38bd477
Compare
|
/testwith openshift/cluster-kube-apiserver-operator/main/e2e-gcp-operator-encryption-kms openshift/cluster-openshift-apiserver-operator#643 openshift/cluster-authentication-operator#832 |
This adds TestKMSEncryptionOnOff which tests the full KMS encryption on/off cycle using the mock KMS plugin from library-go.
38bd477 to
4ae268d
Compare
|
/testwith openshift/cluster-kube-apiserver-operator/main/e2e-gcp-operator-encryption-kms openshift/cluster-openshift-apiserver-operator#643 openshift/cluster-authentication-operator#832 |
4ae268d to
16db423
Compare
|
/testwith openshift/cluster-kube-apiserver-operator/main/e2e-gcp-operator-encryption-kms openshift/cluster-openshift-apiserver-operator#643 openshift/cluster-authentication-operator#832 |
16db423 to
f149af1
Compare
|
/testwith openshift/cluster-kube-apiserver-operator/main/e2e-gcp-operator-encryption-kms openshift/cluster-openshift-apiserver-operator#643 openshift/cluster-authentication-operator#832 |
f149af1 to
780b8a7
Compare
|
/testwith openshift/cluster-kube-apiserver-operator/main/e2e-gcp-operator-encryption-kms openshift/cluster-openshift-apiserver-operator#643 openshift/cluster-authentication-operator#832 |
|
@gangwgr: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
| // 11. Cleans up the KMS plugin | ||
| func TestKMSEncryptionOnOff(t *testing.T) { | ||
| t.Log("KMS encryption on/off test placeholder - CI job validation") | ||
| t.Cleanup(librarykms.DeployUpstreamMockKMSPlugin(context.Background(), t, library.GetClients(t).Kube, librarykms.WellKnownUpstreamMockKMSPluginNamespace, librarykms.WellKnownUpstreamMockKMSPluginImage)) |
There was a problem hiding this comment.
Let’s also add a comment stating that this step is only required for v1. In the future, the platform will manage the plugins, and this code will no longer be needed.
| // 11. Cleans up the KMS plugin | ||
| func TestKMSEncryptionOnOff(t *testing.T) { | ||
| t.Log("KMS encryption on/off test placeholder - CI job validation") | ||
| t.Cleanup(librarykms.DeployUpstreamMockKMSPlugin(context.Background(), t, library.GetClients(t).Kube, librarykms.WellKnownUpstreamMockKMSPluginNamespace, librarykms.WellKnownUpstreamMockKMSPluginImage)) |
There was a problem hiding this comment.
also, once openshift/library-go#2113 merges t.Cleanup won't be needed.
|
/close |
|
PR needs rebase. DetailsInstructions 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. |
|
@gangwgr: Closed this PR. DetailsIn 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. |
Adding KMS TestKMSEncryptionOnOff test