Skip to content

Commit

Permalink
Merge pull request #78 from AlonaKaplan/release-v0.8
Browse files Browse the repository at this point in the history
BZ1779513: make webhook ignoring
  • Loading branch information
phoracek authored Jan 13, 2020
2 parents 0c6c88f + c2d92f2 commit 49c2f54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/webhook/virtualmachine/virtualmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Add(mgr manager.Manager, poolManager *pool_manager.PoolManager, namespaceSe

wh, err := builder.NewWebhookBuilder().
Mutating().
FailurePolicy(admissionregistrationv1beta1.Fail).
FailurePolicy(admissionregistrationv1beta1.Ignore).
Operations(admissionregistrationv1beta1.Create, admissionregistrationv1beta1.Update).
ForType(&kubevirt.VirtualMachine{}).
Handlers(virtualMachineAnnotator).
Expand Down
11 changes: 10 additions & 1 deletion tests/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,21 @@ func setRange(rangeStart, rangeEnd string) error {
}

for _, pod := range podsList.Items {
if !pod.ObjectMeta.DeletionTimestamp.IsZero() {
return fmt.Errorf("old pod %s has not yet been removed\n", pod.Name)
}
if pod.Status.Phase != corev1.PodRunning {
return fmt.Errorf("manager pod not ready")
return fmt.Errorf("manager pod not running")
}
}

return nil

}, 30*time.Second, 3*time.Second).Should(Not(HaveOccurred()), "failed to get kubemacpool manager pod")

// This sleep is temporary and horrible until we have a readiness probe - https://github.com/k8snetworkplumbingwg/kubemacpool/pull/84/
time.Sleep(40 * time.Second)

return nil
}

Expand Down Expand Up @@ -183,6 +189,9 @@ func DeleteLeaderManager() {

return false
}, 30*time.Second, 3*time.Second).Should(BeTrue(), "failed to delete kubemacpool leader pod")

// This sleep is temporary and horrible until we have a readiness probe - https://github.com/k8snetworkplumbingwg/kubemacpool/pull/84/
time.Sleep(40 * time.Second)
}

func BeforeAll(fn func()) {
Expand Down

0 comments on commit 49c2f54

Please sign in to comment.