Example #1
0
		c = f.Client
		ns = f.Namespace.Name
	})

	It("should create a PodDisruptionBudget", func() {
		pdb := policy.PodDisruptionBudget{
			ObjectMeta: api.ObjectMeta{
				Name:      "foo",
				Namespace: ns,
			},
			Spec: policy.PodDisruptionBudgetSpec{
				Selector:     &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
				MinAvailable: intstr.FromString("1%"),
			},
		}
		_, err := c.Policy().PodDisruptionBudgets(ns).Create(&pdb)
		Expect(err).NotTo(HaveOccurred())
	})

	It("should update PodDisruptionBudget status", func() {
		pdb := policy.PodDisruptionBudget{
			ObjectMeta: api.ObjectMeta{
				Name:      "foo",
				Namespace: ns,
			},
			Spec: policy.PodDisruptionBudgetSpec{
				Selector:     &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
				MinAvailable: intstr.FromInt(2),
			},
		}
		_, err := c.Policy().PodDisruptionBudgets(ns).Create(&pdb)