mirror of
https://github.com/rancher/k3k.git
synced 2026-08-18 03:46:31 +00:00
Fix PVC sync and sync defaults (#458)
* Fix PVC sync and sync defaults Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Fix PVC sync and sync defaults Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * fixes to pvc sync Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * increase the timeout on the e2e test Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * configure the syncConfig correctly in vcp Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * update docs Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * fix policy unit test Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * revert timeout of the test to 20 second Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> --------- Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/utils/ptr"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
@@ -195,8 +196,12 @@ var _ = Describe("VirtualClusterPolicy Controller", Label("controller"), Label("
|
||||
|
||||
// Check baseline
|
||||
|
||||
// get policy again
|
||||
err := k8sClient.Get(ctx, client.ObjectKeyFromObject(policy), policy)
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
|
||||
policy.Spec.PodSecurityAdmissionLevel = &baseline
|
||||
err := k8sClient.Update(ctx, policy)
|
||||
err = k8sClient.Update(ctx, policy)
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
|
||||
// wait a bit for the namespace to be updated
|
||||
@@ -486,8 +491,11 @@ var _ = Describe("VirtualClusterPolicy Controller", Label("controller"), Label("
|
||||
WithPolling(time.Second).
|
||||
Should(BeNil())
|
||||
|
||||
// get policy again
|
||||
err := k8sClient.Get(ctx, client.ObjectKeyFromObject(policy), policy)
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
policy.Spec.Quota = nil
|
||||
err := k8sClient.Update(ctx, policy)
|
||||
err = k8sClient.Update(ctx, policy)
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
|
||||
// wait for a bit for the resourceQuota to be deleted
|
||||
|
||||
Reference in New Issue
Block a user