Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/cluster-kube-apiserver-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/openshift/library-go/pkg/operator/staticpod/startupmonitor"

"github.com/openshift/cluster-kube-apiserver-operator/pkg/cmd/certregenerationcontroller"
"github.com/openshift/cluster-kube-apiserver-operator/pkg/operator/targetconfigcontroller"
"github.com/openshift/cluster-kube-apiserver-operator/pkg/cmd/checkendpoints"
"github.com/openshift/cluster-kube-apiserver-operator/pkg/cmd/insecurereadyz"
operatorcmd "github.com/openshift/cluster-kube-apiserver-operator/pkg/cmd/operator"
Expand Down Expand Up @@ -50,7 +51,8 @@ func NewOperatorCommand(ctx context.Context) *cobra.Command {

cmd.AddCommand(operatorcmd.NewOperator())
cmd.AddCommand(render.NewRenderCommand())
cmd.AddCommand(installerpod.NewInstaller(ctx))
opts := installerpod.NewInstallOptions().WithPodMutationFactory(targetconfigcontroller.AddKMSPluginToPodSpecFn)
cmd.AddCommand(installerpod.NewInstallerWithInstallOptions(ctx, opts))
cmd.AddCommand(prune.NewPrune())
cmd.AddCommand(resourcegraph.NewResourceChainCommand())
cmd.AddCommand(certsyncpod.NewCertSyncControllerCommand(operator.CertConfigMaps, operator.CertSecrets))
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,7 @@ require (
sigs.k8s.io/yaml v1.6.0 // indirect
)

replace github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1
replace (
github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1
github.com/openshift/library-go => github.com/ardaguclu/library-go v0.0.0-20260413101015-1a8f3a20dc16
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U=
github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc=
github.com/ardaguclu/library-go v0.0.0-20260413101015-1a8f3a20dc16 h1:VTq5XDxKJZ8zlTlG/1B8gyuftiu32yattTyAkKE0+i4=
github.com/ardaguclu/library-go v0.0.0-20260413101015-1a8f3a20dc16/go.mod h1:3bi4pLpYRdVd1aEhsHfRTJkwxwPLfRZ+ZePn3RmJd2k=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
Expand Down Expand Up @@ -165,8 +167,6 @@ github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee h1:+S
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
github.com/openshift/client-go v0.0.0-20260317180604-743f664b82d1 h1:Hr/R38eg5ZJXfbiaHumjJIN1buDZwhsm4ys4npVCXH0=
github.com/openshift/client-go v0.0.0-20260317180604-743f664b82d1/go.mod h1:Za51LlH76ALiQ/aKGBYJXmyJNkA//IDJ+I///30CA2M=
github.com/openshift/library-go v0.0.0-20260409165127-c57da2bf5720 h1:ljxETzJc/vDgMJlaSB8GRryBHZOAIENA2Wo5arD8avM=
github.com/openshift/library-go v0.0.0-20260409165127-c57da2bf5720/go.mod h1:3bi4pLpYRdVd1aEhsHfRTJkwxwPLfRZ+ZePn3RmJd2k=
github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1 h1:PMTgifBcBRLJJiM+LgSzPDTk9/Rx4qS09OUrfpY6GBQ=
github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
Expand Down
149 changes: 149 additions & 0 deletions pkg/operator/targetconfigcontroller/kms_sidecar.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
package targetconfigcontroller

import (
"context"
"fmt"

"github.com/openshift/library-go/pkg/operator/encryption/encryptionconfig"
"github.com/openshift/library-go/pkg/operator/staticpod/installerpod"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfigv1 "k8s.io/apiserver/pkg/apis/apiserver/v1"
"k8s.io/klog/v2"
)

const (
// TODO: this will be replaced by the kms-provider-config data field from the encryption-key secret
// once the library-go encryption controllers support it.
kmsPluginImage = "quay.io/rhn_support_rgangwar/mock-kms-plugin-vault:latest"
kmsSocketVolumeName = "kms-plugin-socket"
kmsSocketMountPath = "/var/run/kmsplugin"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Hardcoded mock image must be replaced before production use.

The kmsPluginImage constant points to a test image (quay.io/rhn_support_rgangwar/mock-kms-plugin-vault:latest). The TODO comment indicates this will be replaced, but ensure this is tracked and addressed before merging. Using :latest tag is also problematic for reproducibility.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/operator/targetconfigcontroller/kms_sidecar.go` around lines 15 - 21, The
kmsPluginImage constant currently hardcodes a test image
("quay.io/rhn_support_rgangwar/mock-kms-plugin-vault:latest") which must not be
used in production; change the implementation so that kmsPluginImage is not a
hardcoded constant but instead is sourced from a configuration (e.g., the
kms-provider-config field on the encryption-key secret or an operator
ConfigMap/flag/environment variable) and ensure the image tag is fixed (no
":latest") for reproducibility; update any code paths that reference
kmsPluginImage (and keep kmsSocketVolumeName and kmsSocketMountPath as-is) to
read the configured image and validate it exists before deploying.


// AddKMSPluginToPodSpecFn returns a PodMutationFunc that injects KMS plugin
// sidecar containers into the kube-apiserver static pod based on the
// revisioned encryption-config.
//
// The function reads the encryption-config-{revision} secret, parses it to
// find KMS providers, and for each unique KMS endpoint injects a sidecar
// container configured to listen on that endpoint.
func AddKMSPluginToPodSpecFn(o *installerpod.InstallOptions) installerpod.PodMutationFunc {
return func(pod *corev1.Pod) error {
secretName := fmt.Sprintf("%s-%s", encryptionconfig.EncryptionConfSecretName, o.Revision)
secret, err := o.KubeClient.CoreV1().Secrets(o.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{})
if err != nil {
klog.V(4).Infof("No encryption config secret %s/%s: %v", o.Namespace, secretName, err)
return nil
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Swallowing all secret fetch errors may hide real problems.

Returning nil on any error (including permission denied, network issues, etc.) makes debugging difficult. Consider distinguishing between "secret not found" (expected when encryption is disabled) and other errors that indicate actual problems.

Proposed fix
 		secret, err := o.KubeClient.CoreV1().Secrets(o.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{})
 		if err != nil {
-			klog.V(4).Infof("No encryption config secret %s/%s: %v", o.Namespace, secretName, err)
-			return nil
+			if apierrors.IsNotFound(err) {
+				klog.V(4).Infof("No encryption config secret %s/%s, skipping KMS injection", o.Namespace, secretName)
+				return nil
+			}
+			return fmt.Errorf("failed to get encryption config secret %s/%s: %w", o.Namespace, secretName, err)
 		}
📝 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.

Suggested change
secret, err := o.KubeClient.CoreV1().Secrets(o.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{})
if err != nil {
klog.V(4).Infof("No encryption config secret %s/%s: %v", o.Namespace, secretName, err)
return nil
}
secret, err := o.KubeClient.CoreV1().Secrets(o.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{})
if err != nil {
if apierrors.IsNotFound(err) {
klog.V(4).Infof("No encryption config secret %s/%s, skipping KMS injection", o.Namespace, secretName)
return nil
}
return fmt.Errorf("failed to get encryption config secret %s/%s: %w", o.Namespace, secretName, err)
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/operator/targetconfigcontroller/kms_sidecar.go` around lines 33 - 37, The
code is returning nil for any error from o.KubeClient.CoreV1().Secrets(...).Get
which hides real failures; change the error handling to treat only "not found"
as benign and surface all other errors. Specifically, after calling
o.KubeClient.CoreV1().Secrets(o.Namespace).Get(...), use
apierrors.IsNotFound(err) to detect a missing secret (log and return nil) and
for any other error log the failure with context (including err) and return the
error (or wrap it) instead of swallowing it; add the import for
k8s.io/apimachinery/pkg/api/errors as apierrors and update the klog call
locations around secretName and o.Namespace accordingly.


encConfig, err := encryptionconfig.FromSecret(secret)
if err != nil {
return fmt.Errorf("failed to parse encryption config from secret %s: %w", secretName, err)
}
if encConfig == nil {
return nil
}

kmsEndpoints := extractUniqueKMSEndpoints(encConfig)
if len(kmsEndpoints) == 0 {
return nil
}

klog.Infof("Found %d unique KMS endpoint(s), injecting sidecar containers", len(kmsEndpoints))

addKMSSocketVolume(&pod.Spec)

if err := addKMSSocketVolumeMount(&pod.Spec, "kube-apiserver"); err != nil {
return err
}

for keyID, endpoint := range kmsEndpoints {
addKMSSidecarContainer(&pod.Spec, keyID, endpoint)
}

return nil
}
}

// extractUniqueKMSEndpoints returns a map of keyID -> endpoint for all unique
// KMS providers in the encryption config. Multiple resources (e.g., secrets
// and configmaps) that share the same KMS endpoint are deduplicated.
func extractUniqueKMSEndpoints(config *apiserverconfigv1.EncryptionConfiguration) map[string]string {
endpoints := make(map[string]string)
seenEndpoints := make(map[string]bool)

for _, rc := range config.Resources {
for _, provider := range rc.Providers {
if provider.KMS == nil {
continue
}
endpoint := provider.KMS.Endpoint
if seenEndpoints[endpoint] {
continue
}
seenEndpoints[endpoint] = true

keyID := extractKeyIDFromProviderName(provider.KMS.Name)
endpoints[keyID] = endpoint
}
}
return endpoints
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potential keyID collision overwrites earlier endpoints.

If two KMS providers have the same keyID prefix (e.g., 1_secrets and 1_configmaps both yield keyID 1), the endpoints[keyID] = endpoint assignment on line 87 will overwrite the previous entry. While same-keyID providers likely share an endpoint, this assumption isn't validated and could silently lose configuration.

Consider either:

  1. Validating that same-keyID providers have the same endpoint
  2. Using endpoint as the primary key instead of keyID


// extractKeyIDFromProviderName extracts the key ID from a KMS provider name.
// Provider names have the format "{keyID}_{resource}", e.g. "1_secrets".
func extractKeyIDFromProviderName(name string) string {
for i, c := range name {
if c == '_' {
return name[:i]
}
}
return name
}

func addKMSSocketVolume(podSpec *corev1.PodSpec) {
for _, v := range podSpec.Volumes {
if v.Name == kmsSocketVolumeName {
return
}
}

podSpec.Volumes = append(podSpec.Volumes, corev1.Volume{
Name: kmsSocketVolumeName,
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
})
}

func addKMSSocketVolumeMount(podSpec *corev1.PodSpec, containerName string) error {
for i, container := range podSpec.Containers {
if container.Name == containerName {
podSpec.Containers[i].VolumeMounts = append(podSpec.Containers[i].VolumeMounts,
corev1.VolumeMount{
Name: kmsSocketVolumeName,
MountPath: kmsSocketMountPath,
},
)
return nil
}
}
return fmt.Errorf("container %s not found", containerName)
}

func addKMSSidecarContainer(podSpec *corev1.PodSpec, keyID, endpoint string) {
containerName := fmt.Sprintf("kms-plugin-%s", keyID)

podSpec.Containers = append(podSpec.Containers, corev1.Container{
Name: containerName,
Image: kmsPluginImage,
Command: []string{"/mock-vault-kms"},
Args: []string{fmt.Sprintf("--listen-address=%s", endpoint)},
VolumeMounts: []corev1.VolumeMount{
{
Name: kmsSocketVolumeName,
MountPath: kmsSocketMountPath,
},
},
})
}
33 changes: 4 additions & 29 deletions pkg/operator/targetconfigcontroller/targetconfigcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/openshift/library-go/pkg/controller/factory"
"github.com/openshift/library-go/pkg/operator/certrotation"
"github.com/openshift/library-go/pkg/operator/configobserver/featuregates"
encryptionkms "github.com/openshift/library-go/pkg/operator/encryption/kms"
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
"github.com/openshift/library-go/pkg/operator/resource/resourcehelper"
Expand Down Expand Up @@ -58,6 +57,7 @@ type TargetConfigController struct {

kubeClient kubernetes.Interface
configMapLister corev1listers.ConfigMapLister
secretLister corev1listers.SecretLister
featureGateAccessor featuregates.FeatureGateAccess

isStartupMonitorEnabledFn func() (bool, error)
Expand All @@ -82,6 +82,7 @@ func NewTargetConfigController(
operatorClient: operatorClient,
kubeClient: kubeClient,
configMapLister: kubeInformersForNamespaces.ConfigMapLister(),
secretLister: kubeInformersForNamespaces.SecretLister(),
featureGateAccessor: featureGateAccessor,
isStartupMonitorEnabledFn: isStartupMonitorEnabledFn,
requireMultipleEtcdEndpointsFn: requireMultipleEtcdEndpointsFn,
Expand Down Expand Up @@ -224,7 +225,7 @@ func createTargetConfig(ctx context.Context, c TargetConfigController, recorder
if err != nil {
errors = append(errors, fmt.Errorf("%q: %v", "configmap/config", err))
}
_, _, err = managePods(ctx, c.kubeClient.CoreV1(), c.featureGateAccessor, c.isStartupMonitorEnabledFn, recorder, operatorSpec, c.targetImagePullSpec, c.operatorImagePullSpec, c.operatorImageVersion)
_, _, err = managePods(ctx, c.kubeClient.CoreV1(), c.featureGateAccessor, c.isStartupMonitorEnabledFn, recorder, operatorSpec, c.targetImagePullSpec, c.operatorImagePullSpec, c.operatorImageVersion, c.secretLister)
if err != nil {
errors = append(errors, fmt.Errorf("%q: %v", "configmap/kube-apiserver-pod", err))
}
Expand Down Expand Up @@ -308,7 +309,7 @@ func manageKubeAPIServerConfig(ctx context.Context, client coreclientv1.ConfigMa
return resourceapply.ApplyConfigMap(ctx, client, recorder, requiredConfigMap)
}

func managePods(ctx context.Context, client coreclientv1.ConfigMapsGetter, featureGateAccessor featuregates.FeatureGateAccess, isStartupMonitorEnabledFn func() (bool, error), recorder events.Recorder, operatorSpec *operatorv1.StaticPodOperatorSpec, imagePullSpec, operatorImagePullSpec, operatorImageVersion string) (*corev1.ConfigMap, bool, error) {
func managePods(ctx context.Context, client coreclientv1.ConfigMapsGetter, featureGateAccessor featuregates.FeatureGateAccess, isStartupMonitorEnabledFn func() (bool, error), recorder events.Recorder, operatorSpec *operatorv1.StaticPodOperatorSpec, imagePullSpec, operatorImagePullSpec, operatorImageVersion string, secretLister corev1listers.SecretLister) (*corev1.ConfigMap, bool, error) {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
appliedPodTemplate, err := manageTemplate(string(bindata.MustAsset("assets/kube-apiserver/pod.yaml")), imagePullSpec, operatorImagePullSpec, operatorImageVersion, operatorSpec)
if err != nil {
return nil, false, err
Expand All @@ -329,10 +330,6 @@ func managePods(ctx context.Context, client coreclientv1.ConfigMapsGetter, featu
required.Spec.Containers[i].Env = append(container.Env, proxyEnvVars...)
}

if err := encryptionkms.AddKMSPluginVolumeAndMountToPodSpec(&required.Spec, "kube-apiserver", featureGateAccessor); err != nil {
return nil, false, fmt.Errorf("failed to add KMS encryption volumes: %w", err)
}

configMap := resourceread.ReadConfigMapV1OrDie(bindata.MustAsset("assets/kube-apiserver/pod-cm.yaml"))
configMap.Data["pod.yaml"] = resourceread.WritePodV1OrDie(required)
configMap.Data["forceRedeploymentReason"] = operatorSpec.ForceRedeploymentReason
Expand Down Expand Up @@ -580,21 +577,6 @@ func proxyMapToEnvVars(proxyConfig map[string]string) []corev1.EnvVar {
return envVars
}

// checkEndpointsBindIPFromConfig returns the bind ip address to be used by the
// check-endpoints container inside the apiserver pod. The bind IP is derived
// from the bindNetwork property of the config.
func checkEndpointsBindIPFromConfig(config map[string]any) (string, error) {
var bindNetworkPath = []string{"servingInfo", "bindNetwork"}
observedBindNetwork, _, err := unstructured.NestedString(config, bindNetworkPath...)
if err != nil {
return "", fmt.Errorf("unable to extract bindNetwork from the observed config: %v, path = %v", err, bindNetworkPath)
}
if observedBindNetwork == "tcp6" {
return "[::]", nil
}
return "0.0.0.0", nil
}

func gracefulTerminationDurationFromConfig(config map[string]interface{}) (int, error) {
// 135s is our default value
// the initial 70s is reserved fo the minimal termination period
Expand Down Expand Up @@ -656,7 +638,6 @@ type kasTemplate struct {
GracefulTerminationDuration int
SetupContainerTimeoutDuration int
GOGC int
CheckEndpointsBindIP string
}

func effectiveConfiguration(spec *operatorv1.StaticPodOperatorSpec) (map[string]interface{}, error) {
Expand Down Expand Up @@ -703,11 +684,6 @@ func manageTemplate(rawTemplate string, imagePullSpec string, operatorImagePullS
return "", err
}

checkEndpointBindIP, err := checkEndpointsBindIPFromConfig(config)
if err != nil {
return "", err
}

tmplVal := kasTemplate{
Image: imagePullSpec,
OperatorImage: operatorImagePullSpec,
Expand All @@ -717,7 +693,6 @@ func manageTemplate(rawTemplate string, imagePullSpec string, operatorImagePullS
// 80s for minimum-termination-duration (10s port wait, 65s to let pending requests finish after port has been freed) + 5s extra cri-o's graceful termination period
SetupContainerTimeoutDuration: gracefulTerminationDuration + 80 + 5,
GOGC: gogc,
CheckEndpointsBindIP: checkEndpointBindIP,
}
tmpl, err := template.New("kas").Parse(rawTemplate)
if err != nil {
Expand Down
9 changes: 3 additions & 6 deletions test/e2e-encryption-kms/encryption_kms_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package e2e_encryption_kms

import (
"context"
"fmt"
"math/rand/v2"
"testing"

configv1 "github.com/openshift/api/config/v1"
"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"
librarykms "github.com/openshift/library-go/test/library/encryption/kms"
)

// TestKMSEncryptionOnOff tests KMS encryption on/off cycle.
Expand All @@ -29,7 +26,7 @@ func TestKMSEncryptionOnOff(t *testing.T) {
// Deploy the mock KMS plugin for testing.
// NOTE: This manual deployment is only required for KMS v1. In the future,
// the platform will manage the KMS plugins, and this code will no longer be needed.
librarykms.DeployUpstreamMockKMSPlugin(context.Background(), t, library.GetClients(t).Kube, librarykms.WellKnownUpstreamMockKMSPluginNamespace, librarykms.WellKnownUpstreamMockKMSPluginImage)
// librarykms.DeployUpstreamMockKMSPlugin(context.Background(), t, library.GetClients(t).Kube, librarykms.WellKnownUpstreamMockKMSPluginNamespace, librarykms.WellKnownUpstreamMockKMSPluginImage)
library.TestEncryptionTurnOnAndOff(t, library.OnOffScenario{
BasicScenario: library.BasicScenario{
Namespace: operatorclient.GlobalMachineSpecifiedConfigNamespace,
Expand Down Expand Up @@ -57,7 +54,7 @@ func TestKMSEncryptionOnOff(t *testing.T) {
// 4. Shuffles the selected AES provider with KMS to create a randomized migration order
// 5. Migrates between the providers in the shuffled order
// 6. Verifies secret is correctly encrypted after each migration
func TestKMSEncryptionProvidersMigration(t *testing.T) {
/*func TestKMSEncryptionProvidersMigration(t *testing.T) {
librarykms.DeployUpstreamMockKMSPlugin(context.Background(), t, library.GetClients(t).Kube, librarykms.WellKnownUpstreamMockKMSPluginNamespace, librarykms.WellKnownUpstreamMockKMSPluginImage)
library.TestEncryptionProvidersMigration(t, library.ProvidersMigrationScenario{
BasicScenario: library.BasicScenario{
Expand All @@ -76,4 +73,4 @@ func TestKMSEncryptionProvidersMigration(t *testing.T) {
ResourceName: "SecretOfLife",
EncryptionProviders: library.ShuffleEncryptionProviders([]configv1.EncryptionType{configv1.EncryptionTypeKMS, library.SupportedStaticEncryptionProviders[rand.IntN(len(library.SupportedStaticEncryptionProviders))]}),
})
}
}*/

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading