-
Notifications
You must be signed in to change notification settings - Fork 100
CNTRLPLANE-2247:Adding KMS TestKMSEncryptionOnOff test for Routes #644
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
|
Skipping CI for Draft Pull Request. |
|
@ardaguclu: This pull request references CNTRLPLANE-2247 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
| ctx := context.TODO() | ||
| cs := operatorencryption.GetClients(t) | ||
|
|
||
| ns := fmt.Sprintf("test-kms-encryption-on-off-%s", rand.String(4)) |
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.
why is this required ?
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.
E2E framework in this repo is designed that way
cluster-openshift-apiserver-operator/test/e2e-encryption/encryption_test.go
Lines 52 to 74 in 3f56d50
| ns := fmt.Sprintf("test-encryption-on-off-%s", rand.String(4)) | |
| _, err := cs.KubeClient.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ns}}, metav1.CreateOptions{}) | |
| require.NoError(t, err) | |
| defer cs.KubeClient.CoreV1().Namespaces().Delete(ctx, ns, metav1.DeleteOptions{}) | |
| library.TestEncryptionTurnOnAndOff(t, library.OnOffScenario{ | |
| BasicScenario: library.BasicScenario{ | |
| Namespace: operatorclient.GlobalMachineSpecifiedConfigNamespace, | |
| LabelSelector: "encryption.apiserver.operator.openshift.io/component" + "=" + operatorclient.TargetNamespace, | |
| EncryptionConfigSecretName: fmt.Sprintf("encryption-config-%s", operatorclient.TargetNamespace), | |
| EncryptionConfigSecretNamespace: operatorclient.GlobalMachineSpecifiedConfigNamespace, | |
| OperatorNamespace: operatorclient.OperatorNamespace, | |
| TargetGRs: operatorencryption.DefaultTargetGRs, | |
| AssertFunc: operatorencryption.AssertRoutes, | |
| }, | |
| CreateResourceFunc: func(t testing.TB, _ library.ClientSet, namespace string) runtime.Object { | |
| return operatorencryption.CreateAndStoreRouteOfLife(context.TODO(), t, operatorencryption.GetClients(t), ns) | |
| }, | |
| AssertResourceEncryptedFunc: operatorencryption.AssertRouteOfLifeEncrypted, | |
| AssertResourceNotEncryptedFunc: operatorencryption.AssertRouteOfLifeNotEncrypted, | |
| ResourceFunc: func(t testing.TB, _ string) runtime.Object { return operatorencryption.RouteOfLife(t, ns) }, | |
| ResourceName: "RouteOfLife", | |
| EncryptionProvider: configv1.EncryptionType(*provider), |
CreateAndStoreRouteOfLife and RouteOfLife functions expect ns.
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.
ah, ic, thanks.
|
/approve |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, gangwgr, p0lyn0mial The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Failure of e2e-gcp-operator-encryption-kms is expected. Because controllers are not ready to handle KMS encryption type yet (i.e. openshift/library-go#2086). |
|
@ardaguclu: This PR has been marked as verified by 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 openshift-eng/jira-lifecycle-plugin repository. |
cc1d7ad
into
openshift:main
This PR is mirror of;
in order to enable KMS on/off test scenario in aggregated apiserver operators.
Until openshift/library-go#2086 is landed, tests will fail. However, since the test is marked as option, this won't create any issues.