From 26acced6d8bdc885d101cb79569c61a1d5a6dcde Mon Sep 17 00:00:00 2001
From: Marcin
Date: Wed, 26 Oct 2016 10:40:07 +0200
Subject: [PATCH 1/6] Add policy api version v1beta1 and disable v1alpha1
---
.../app/controllermanager.go | 2 +-
.../go2idl/go-to-protobuf/protobuf/cmd.go | 2 +-
hack/lib/init.sh | 2 +-
pkg/api/testing/fuzzer.go | 5 ++
pkg/api/unversioned/group_version_test.go | 6 +-
pkg/apis/policy/install/install.go | 6 +-
pkg/apis/policy/types.go | 4 +-
pkg/apis/policy/v1beta1/register.go | 50 ++++++++++++
pkg/apis/policy/validation/validation.go | 12 +++
pkg/apis/policy/validation/validation_test.go | 25 ++++++
pkg/controller/disruption/disruption.go | 21 ++---
pkg/controller/disruption/disruption_test.go | 76 ++++++++++---------
pkg/master/master.go | 4 +-
pkg/registry/core/pod/etcd/eviction.go | 10 ++-
pkg/registry/core/rest/storage_core.go | 4 +-
.../poddisruptionbudget/strategy_test.go | 24 +++---
pkg/registry/policy/rest/storage_policy.go | 14 ++--
test/e2e/disruption.go | 2 +-
18 files changed, 185 insertions(+), 84 deletions(-)
create mode 100644 pkg/apis/policy/v1beta1/register.go
diff --git a/cmd/kube-controller-manager/app/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go
index 06733080abd..86b46f29ade 100644
--- a/cmd/kube-controller-manager/app/controllermanager.go
+++ b/cmd/kube-controller-manager/app/controllermanager.go
@@ -426,7 +426,7 @@ func StartControllers(s *options.CMServer, kubeconfig *restclient.Config, rootCl
}
}
- groupVersion = "policy/v1alpha1"
+ groupVersion = "policy/v1beta1"
resources, found = resourceMap[groupVersion]
glog.Infof("Attempting to start disruption controller, full resource map %+v", resourceMap)
if containsVersion(versions, groupVersion) && found {
diff --git a/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go b/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
index 4be1c8f2729..e900dfb9b22 100644
--- a/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
+++ b/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
@@ -66,7 +66,7 @@ func New() *Generator {
`+k8s.io/kubernetes/pkg/watch/versioned`,
`k8s.io/kubernetes/pkg/api/unversioned`,
`k8s.io/kubernetes/pkg/api/v1`,
- `k8s.io/kubernetes/pkg/apis/policy/v1alpha1`,
+ `k8s.io/kubernetes/pkg/apis/policy/v1beta1`,
`k8s.io/kubernetes/pkg/apis/extensions/v1beta1`,
`k8s.io/kubernetes/pkg/apis/autoscaling/v1`,
`k8s.io/kubernetes/pkg/apis/authorization/v1beta1`,
diff --git a/hack/lib/init.sh b/hack/lib/init.sh
index 04814326c37..015cf8d5117 100644
--- a/hack/lib/init.sh
+++ b/hack/lib/init.sh
@@ -58,7 +58,7 @@ batch/v2alpha1 \
certificates.k8s.io/v1alpha1 \
extensions/v1beta1 \
imagepolicy.k8s.io/v1alpha1 \
-policy/v1alpha1 \
+policy/v1beta1 \
rbac.authorization.k8s.io/v1alpha1 \
storage.k8s.io/v1beta1\
}"
diff --git a/pkg/api/testing/fuzzer.go b/pkg/api/testing/fuzzer.go
index c95e67d6523..383e0422eba 100644
--- a/pkg/api/testing/fuzzer.go
+++ b/pkg/api/testing/fuzzer.go
@@ -31,6 +31,7 @@ import (
"k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/apis/extensions"
+ "k8s.io/kubernetes/pkg/apis/policy"
"k8s.io/kubernetes/pkg/apis/rbac"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels"
@@ -552,6 +553,10 @@ func FuzzerFor(t *testing.T, version unversioned.GroupVersion, src rand.Source)
obj.APIPort = 20
obj.DiscoveryPort = 20
},
+ func(s *policy.PodDisruptionBudgetStatus, c fuzz.Continue) {
+ c.FuzzNoCustom(s) // fuzz self without calling this function again
+ s.PodDisruptionsAllowed = int32(c.Rand.Intn(2))
+ },
)
return f
}
diff --git a/pkg/api/unversioned/group_version_test.go b/pkg/api/unversioned/group_version_test.go
index 510a8a460e7..3c01712a55d 100644
--- a/pkg/api/unversioned/group_version_test.go
+++ b/pkg/api/unversioned/group_version_test.go
@@ -152,7 +152,7 @@ func TestKindForGroupVersionKinds(t *testing.T) {
gvks := GroupVersions{
GroupVersion{Group: "batch", Version: "v1"},
GroupVersion{Group: "batch", Version: "v2alpha1"},
- GroupVersion{Group: "policy", Version: "v1alpha1"},
+ GroupVersion{Group: "policy", Version: "v1beta1"},
}
cases := []struct {
input []GroupVersionKind
@@ -170,8 +170,8 @@ func TestKindForGroupVersionKinds(t *testing.T) {
ok: true,
},
{
- input: []GroupVersionKind{{Group: "policy", Version: "v1alpha1", Kind: "PodDisruptionBudget"}},
- target: GroupVersionKind{Group: "policy", Version: "v1alpha1", Kind: "PodDisruptionBudget"},
+ input: []GroupVersionKind{{Group: "policy", Version: "v1beta1", Kind: "PodDisruptionBudget"}},
+ target: GroupVersionKind{Group: "policy", Version: "v1beta1", Kind: "PodDisruptionBudget"},
ok: true,
},
{
diff --git a/pkg/apis/policy/install/install.go b/pkg/apis/policy/install/install.go
index f5e533540bb..69db365b97b 100644
--- a/pkg/apis/policy/install/install.go
+++ b/pkg/apis/policy/install/install.go
@@ -21,19 +21,19 @@ package install
import (
"k8s.io/kubernetes/pkg/apimachinery/announced"
"k8s.io/kubernetes/pkg/apis/policy"
- "k8s.io/kubernetes/pkg/apis/policy/v1alpha1"
+ "k8s.io/kubernetes/pkg/apis/policy/v1beta1"
)
func init() {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: policy.GroupName,
- VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version},
+ VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version},
ImportPrefix: "k8s.io/kubernetes/pkg/apis/policy",
AddInternalObjectsToScheme: policy.AddToScheme,
},
announced.VersionToSchemeFunc{
- v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme,
+ v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme,
},
).Announce().RegisterAndEnable(); err != nil {
panic(err)
diff --git a/pkg/apis/policy/types.go b/pkg/apis/policy/types.go
index 508688977a0..97e58beec94 100644
--- a/pkg/apis/policy/types.go
+++ b/pkg/apis/policy/types.go
@@ -40,8 +40,8 @@ type PodDisruptionBudgetSpec struct {
// PodDisruptionBudgetStatus represents information about the status of a
// PodDisruptionBudget. Status may trail the actual state of a system.
type PodDisruptionBudgetStatus struct {
- // Whether or not a disruption is currently allowed.
- PodDisruptionAllowed bool `json:"disruptionAllowed"`
+ // Number of pod disruptions that are currently allowed.
+ PodDisruptionsAllowed int32 `json:"disruptionsAllowed"`
// current number of healthy pods
CurrentHealthy int32 `json:"currentHealthy"`
diff --git a/pkg/apis/policy/v1beta1/register.go b/pkg/apis/policy/v1beta1/register.go
new file mode 100644
index 00000000000..d293f80497f
--- /dev/null
+++ b/pkg/apis/policy/v1beta1/register.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2015 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "k8s.io/kubernetes/pkg/api/unversioned"
+ "k8s.io/kubernetes/pkg/api/v1"
+ "k8s.io/kubernetes/pkg/runtime"
+ versionedwatch "k8s.io/kubernetes/pkg/watch/versioned"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "policy"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta1"}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to api.Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &PodDisruptionBudget{},
+ &PodDisruptionBudgetList{},
+ &Eviction{},
+ &v1.ListOptions{},
+ &v1.DeleteOptions{},
+ &v1.ExportOptions{},
+ )
+ // Add the watch version that applies
+ versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/pkg/apis/policy/validation/validation.go b/pkg/apis/policy/validation/validation.go
index e11498e7075..886583f0b59 100644
--- a/pkg/apis/policy/validation/validation.go
+++ b/pkg/apis/policy/validation/validation.go
@@ -20,6 +20,7 @@ import (
"reflect"
unversionedvalidation "k8s.io/kubernetes/pkg/api/unversioned/validation"
+ apivalidation "k8s.io/kubernetes/pkg/api/validation"
extensionsvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
"k8s.io/kubernetes/pkg/apis/policy"
"k8s.io/kubernetes/pkg/util/validation/field"
@@ -27,6 +28,7 @@ import (
func ValidatePodDisruptionBudget(pdb *policy.PodDisruptionBudget) field.ErrorList {
allErrs := ValidatePodDisruptionBudgetSpec(pdb.Spec, field.NewPath("spec"))
+ allErrs = append(allErrs, ValidatePodDisruptionBudgetStatus(pdb.Status, field.NewPath("status"))...)
return allErrs
}
@@ -39,6 +41,7 @@ func ValidatePodDisruptionBudgetUpdate(pdb, oldPdb *policy.PodDisruptionBudget)
if !reflect.DeepEqual(pdb, oldPdb) {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to poddisruptionbudget spec are forbidden."))
}
+ allErrs = append(allErrs, ValidatePodDisruptionBudgetStatus(pdb.Status, field.NewPath("status"))...)
pdb.Generation = restoreGeneration
return allErrs
@@ -53,3 +56,12 @@ func ValidatePodDisruptionBudgetSpec(spec policy.PodDisruptionBudgetSpec, fldPat
return allErrs
}
+
+func ValidatePodDisruptionBudgetStatus(status policy.PodDisruptionBudgetStatus, fldPath *field.Path) field.ErrorList {
+ allErrs := field.ErrorList{}
+ allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.PodDisruptionsAllowed), fldPath.Child("podDisruptionsAllowed"))...)
+ allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.CurrentHealthy), fldPath.Child("currentHealthy"))...)
+ allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.DesiredHealthy), fldPath.Child("desiredHealthy"))...)
+ allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.ExpectedPods), fldPath.Child("expectedPods"))...)
+ return allErrs
+}
diff --git a/pkg/apis/policy/validation/validation_test.go b/pkg/apis/policy/validation/validation_test.go
index cb998f3638c..77e7a90b056 100644
--- a/pkg/apis/policy/validation/validation_test.go
+++ b/pkg/apis/policy/validation/validation_test.go
@@ -60,3 +60,28 @@ func TestValidatePodDisruptionBudgetSpec(t *testing.T) {
}
}
}
+
+func TestValidatePodDisruptionBudgetStatus(t *testing.T) {
+ successCases := []policy.PodDisruptionBudgetStatus{
+ {PodDisruptionsAllowed: 10},
+ {CurrentHealthy: 5},
+ {DesiredHealthy: 3},
+ {ExpectedPods: 2}}
+ for _, c := range successCases {
+ errors := ValidatePodDisruptionBudgetStatus(c, field.NewPath("status"))
+ if len(errors) > 0 {
+ t.Errorf("unexpected failure %v for %v", errors, c)
+ }
+ }
+ failureCases := []policy.PodDisruptionBudgetStatus{
+ {PodDisruptionsAllowed: -10},
+ {CurrentHealthy: -5},
+ {DesiredHealthy: -3},
+ {ExpectedPods: -2}}
+ for _, c := range failureCases {
+ errors := ValidatePodDisruptionBudgetStatus(c, field.NewPath("status"))
+ if len(errors) == 0 {
+ t.Errorf("unexpected success for %v", c)
+ }
+ }
+}
diff --git a/pkg/controller/disruption/disruption.go b/pkg/controller/disruption/disruption.go
index db74ec79ab9..55ec5e7e940 100644
--- a/pkg/controller/disruption/disruption.go
+++ b/pkg/controller/disruption/disruption.go
@@ -541,8 +541,8 @@ Pod:
return
}
-// failSafe is an attempt to at least update the PodDisruptionAllowed field to
-// false if everything something else has failed. This is one place we
+// failSafe is an attempt to at least update the PodDisruptionsAllowed field to
+// 0 if everything else has failed. This is one place we
// implement the "fail open" part of the design since if we manage to update
// this field correctly, we will prevent the /evict handler from approving an
// eviction when it may be unsafe to do so.
@@ -552,7 +552,7 @@ func (dc *DisruptionController) failSafe(pdb *policy.PodDisruptionBudget) error
return err
}
newPdb := obj.(policy.PodDisruptionBudget)
- newPdb.Status.PodDisruptionAllowed = false
+ newPdb.Status.PodDisruptionsAllowed = 0
return dc.getUpdater()(&newPdb)
}
@@ -562,9 +562,12 @@ func (dc *DisruptionController) updatePdbSpec(pdb *policy.PodDisruptionBudget, c
// pods are in a safe state when their first pods appear but this controller
// has not updated their status yet. This isn't the only race, but it's a
// common one that's easy to detect.
- disruptionAllowed := currentHealthy-1 >= desiredHealthy && expectedCount > 0
+ disruptionsAllowed := currentHealthy - desiredHealthy
+ if expectedCount <= 0 || disruptionsAllowed <= 0 {
+ disruptionsAllowed = 0
+ }
- if pdb.Status.CurrentHealthy == currentHealthy && pdb.Status.DesiredHealthy == desiredHealthy && pdb.Status.ExpectedPods == expectedCount && pdb.Status.PodDisruptionAllowed == disruptionAllowed {
+ if pdb.Status.CurrentHealthy == currentHealthy && pdb.Status.DesiredHealthy == desiredHealthy && pdb.Status.ExpectedPods == expectedCount && pdb.Status.PodDisruptionsAllowed == disruptionsAllowed {
return nil
}
@@ -575,10 +578,10 @@ func (dc *DisruptionController) updatePdbSpec(pdb *policy.PodDisruptionBudget, c
newPdb := obj.(policy.PodDisruptionBudget)
newPdb.Status = policy.PodDisruptionBudgetStatus{
- CurrentHealthy: currentHealthy,
- DesiredHealthy: desiredHealthy,
- ExpectedPods: expectedCount,
- PodDisruptionAllowed: disruptionAllowed,
+ CurrentHealthy: currentHealthy,
+ DesiredHealthy: desiredHealthy,
+ ExpectedPods: expectedCount,
+ PodDisruptionsAllowed: disruptionsAllowed,
}
return dc.getUpdater()(&newPdb)
diff --git a/pkg/controller/disruption/disruption_test.go b/pkg/controller/disruption/disruption_test.go
index 89b04db9dd0..85c66622ce8 100644
--- a/pkg/controller/disruption/disruption_test.go
+++ b/pkg/controller/disruption/disruption_test.go
@@ -19,6 +19,7 @@ package disruption
import (
"fmt"
"reflect"
+ "runtime/debug"
"testing"
"k8s.io/kubernetes/pkg/api"
@@ -53,23 +54,25 @@ func (ps *pdbStates) Get(key string) policy.PodDisruptionBudget {
return (*ps)[key]
}
-func (ps *pdbStates) VerifyPdbStatus(t *testing.T, key string, disruptionAllowed bool, currentHealthy, desiredHealthy, expectedPods int32) {
+func (ps *pdbStates) VerifyPdbStatus(t *testing.T, key string, disruptionsAllowed, currentHealthy, desiredHealthy, expectedPods int32) {
expectedStatus := policy.PodDisruptionBudgetStatus{
- PodDisruptionAllowed: disruptionAllowed,
- CurrentHealthy: currentHealthy,
- DesiredHealthy: desiredHealthy,
- ExpectedPods: expectedPods,
+ PodDisruptionsAllowed: disruptionsAllowed,
+ CurrentHealthy: currentHealthy,
+ DesiredHealthy: desiredHealthy,
+ ExpectedPods: expectedPods,
}
actualStatus := ps.Get(key).Status
if !reflect.DeepEqual(actualStatus, expectedStatus) {
+ debug.PrintStack()
t.Fatalf("PDB %q status mismatch. Expected %+v but got %+v.", key, expectedStatus, actualStatus)
}
}
-func (ps *pdbStates) VerifyDisruptionAllowed(t *testing.T, key string, disruptionAllowed bool) {
+func (ps *pdbStates) VerifyDisruptionAllowed(t *testing.T, key string, disruptionsAllowed int32) {
pdb := ps.Get(key)
- if pdb.Status.PodDisruptionAllowed != disruptionAllowed {
- t.Fatalf("PodDisruptionAllowed mismatch for PDB %q. Expected %v but got %v.", key, disruptionAllowed, pdb.Status.PodDisruptionAllowed)
+ if pdb.Status.PodDisruptionsAllowed != disruptionsAllowed {
+ debug.PrintStack()
+ t.Fatalf("PodDisruptionAllowed mismatch for PDB %q. Expected %v but got %v.", key, disruptionsAllowed, pdb.Status.PodDisruptionsAllowed)
}
}
@@ -248,11 +251,11 @@ func TestNoSelector(t *testing.T) {
add(t, dc.pdbLister.Store, pdb)
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, false, 0, 3, 0)
+ ps.VerifyPdbStatus(t, pdbName, 0, 0, 3, 0)
add(t, dc.podLister.Indexer, pod)
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, false, 0, 3, 0)
+ ps.VerifyPdbStatus(t, pdbName, 0, 0, 3, 0)
}
// Verify that available/expected counts go up as we add pods, then verify that
@@ -267,13 +270,13 @@ func TestUnavailable(t *testing.T) {
// Add three pods, verifying that the counts go up at each step.
pods := []*api.Pod{}
for i := int32(0); i < 4; i++ {
- ps.VerifyPdbStatus(t, pdbName, false, i, 3, i)
+ ps.VerifyPdbStatus(t, pdbName, 0, i, 3, i)
pod, _ := newPod(t, fmt.Sprintf("yo-yo-yo %d", i))
pods = append(pods, pod)
add(t, dc.podLister.Indexer, pod)
dc.sync(pdbName)
}
- ps.VerifyPdbStatus(t, pdbName, true, 4, 3, 4)
+ ps.VerifyPdbStatus(t, pdbName, 1, 4, 3, 4)
// Now set one pod as unavailable
pods[0].Status.Conditions = []api.PodCondition{}
@@ -281,7 +284,7 @@ func TestUnavailable(t *testing.T) {
dc.sync(pdbName)
// Verify expected update
- ps.VerifyPdbStatus(t, pdbName, false, 3, 3, 4)
+ ps.VerifyPdbStatus(t, pdbName, 0, 3, 3, 4)
}
// Create a pod with no controller, and verify that a PDB with a percentage
@@ -293,13 +296,13 @@ func TestNakedPod(t *testing.T) {
add(t, dc.pdbLister.Store, pdb)
dc.sync(pdbName)
// This verifies that when a PDB has 0 pods, disruptions are not allowed.
- ps.VerifyDisruptionAllowed(t, pdbName, false)
+ ps.VerifyDisruptionAllowed(t, pdbName, 0)
pod, _ := newPod(t, "naked")
add(t, dc.podLister.Indexer, pod)
dc.sync(pdbName)
- ps.VerifyDisruptionAllowed(t, pdbName, false)
+ ps.VerifyDisruptionAllowed(t, pdbName, 0)
}
// Verify that we count the scale of a ReplicaSet even when it has no Deployment.
@@ -315,7 +318,7 @@ func TestReplicaSet(t *testing.T) {
pod, _ := newPod(t, "pod")
add(t, dc.podLister.Indexer, pod)
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, false, 1, 2, 10)
+ ps.VerifyPdbStatus(t, pdbName, 0, 1, 2, 10)
}
// Verify that multiple controllers doesn't allow the PDB to be set true.
@@ -335,7 +338,7 @@ func TestMultipleControllers(t *testing.T) {
dc.sync(pdbName)
// No controllers yet => no disruption allowed
- ps.VerifyDisruptionAllowed(t, pdbName, false)
+ ps.VerifyDisruptionAllowed(t, pdbName, 0)
rc, _ := newReplicationController(t, 1)
rc.Name = "rc 1"
@@ -343,7 +346,7 @@ func TestMultipleControllers(t *testing.T) {
dc.sync(pdbName)
// One RC and 200%>1% healthy => disruption allowed
- ps.VerifyDisruptionAllowed(t, pdbName, true)
+ ps.VerifyDisruptionAllowed(t, pdbName, 1)
rc, _ = newReplicationController(t, 1)
rc.Name = "rc 2"
@@ -351,7 +354,7 @@ func TestMultipleControllers(t *testing.T) {
dc.sync(pdbName)
// 100%>1% healthy BUT two RCs => no disruption allowed
- ps.VerifyDisruptionAllowed(t, pdbName, false)
+ ps.VerifyDisruptionAllowed(t, pdbName, 0)
}
func TestReplicationController(t *testing.T) {
@@ -375,7 +378,7 @@ func TestReplicationController(t *testing.T) {
dc.sync(pdbName)
// It starts out at 0 expected because, with no pods, the PDB doesn't know
// about the RC. This is a known bug. TODO(mml): file issue
- ps.VerifyPdbStatus(t, pdbName, false, 0, 0, 0)
+ ps.VerifyPdbStatus(t, pdbName, 0, 0, 0, 0)
pods := []*api.Pod{}
@@ -386,16 +389,16 @@ func TestReplicationController(t *testing.T) {
add(t, dc.podLister.Indexer, pod)
dc.sync(pdbName)
if i < 2 {
- ps.VerifyPdbStatus(t, pdbName, false, i+1, 2, 3)
+ ps.VerifyPdbStatus(t, pdbName, 0, i+1, 2, 3)
} else {
- ps.VerifyPdbStatus(t, pdbName, true, 3, 2, 3)
+ ps.VerifyPdbStatus(t, pdbName, 1, 3, 2, 3)
}
}
rogue, _ := newPod(t, "rogue")
add(t, dc.podLister.Indexer, rogue)
dc.sync(pdbName)
- ps.VerifyDisruptionAllowed(t, pdbName, false)
+ ps.VerifyDisruptionAllowed(t, pdbName, 0)
}
func TestTwoControllers(t *testing.T) {
@@ -427,7 +430,7 @@ func TestTwoControllers(t *testing.T) {
add(t, dc.rcLister.Indexer, rc)
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, false, 0, 0, 0)
+ ps.VerifyPdbStatus(t, pdbName, 0, 0, 0, 0)
pods := []*api.Pod{}
@@ -442,11 +445,11 @@ func TestTwoControllers(t *testing.T) {
add(t, dc.podLister.Indexer, pod)
dc.sync(pdbName)
if i <= unavailablePods {
- ps.VerifyPdbStatus(t, pdbName, false, 0, minimumOne, collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 0, 0, minimumOne, collectionSize)
} else if i-unavailablePods <= minimumOne {
- ps.VerifyPdbStatus(t, pdbName, false, i-unavailablePods, minimumOne, collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 0, i-unavailablePods, minimumOne, collectionSize)
} else {
- ps.VerifyPdbStatus(t, pdbName, true, i-unavailablePods, minimumOne, collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 1, i-unavailablePods, minimumOne, collectionSize)
}
}
@@ -454,14 +457,14 @@ func TestTwoControllers(t *testing.T) {
d.Spec.Selector = newSel(dLabels)
add(t, dc.dLister.Indexer, d)
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, true, minimumOne+1, minimumOne, collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 1, minimumOne+1, minimumOne, collectionSize)
rs, _ := newReplicaSet(t, collectionSize)
rs.Spec.Selector = newSel(dLabels)
rs.Labels = dLabels
add(t, dc.rsLister.Indexer, rs)
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, true, minimumOne+1, minimumOne, collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 1, minimumOne+1, minimumOne, collectionSize)
// By the end of this loop, the number of ready pods should be N+2 (hence minimumTwo+2).
unavailablePods = 2*collectionSize - (minimumTwo + 2) - unavailablePods
@@ -475,32 +478,33 @@ func TestTwoControllers(t *testing.T) {
add(t, dc.podLister.Indexer, pod)
dc.sync(pdbName)
if i <= unavailablePods {
- ps.VerifyPdbStatus(t, pdbName, false, minimumOne+1, minimumTwo, 2*collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 0, minimumOne+1, minimumTwo, 2*collectionSize)
} else if i-unavailablePods <= minimumTwo-(minimumOne+1) {
- ps.VerifyPdbStatus(t, pdbName, false, (minimumOne+1)+(i-unavailablePods), minimumTwo, 2*collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 0, (minimumOne+1)+(i-unavailablePods), minimumTwo, 2*collectionSize)
} else {
- ps.VerifyPdbStatus(t, pdbName, true, (minimumOne+1)+(i-unavailablePods), minimumTwo, 2*collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, i-unavailablePods-(minimumTwo-(minimumOne+1)),
+ (minimumOne+1)+(i-unavailablePods), minimumTwo, 2*collectionSize)
}
}
// Now we verify we can bring down 1 pod and a disruption is still permitted,
// but if we bring down two, it's not. Then we make the pod ready again and
// verify that a disruption is permitted again.
- ps.VerifyPdbStatus(t, pdbName, true, 2+minimumTwo, minimumTwo, 2*collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 2, 2+minimumTwo, minimumTwo, 2*collectionSize)
pods[collectionSize-1].Status.Conditions = []api.PodCondition{}
update(t, dc.podLister.Indexer, pods[collectionSize-1])
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, true, 1+minimumTwo, minimumTwo, 2*collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 1, 1+minimumTwo, minimumTwo, 2*collectionSize)
pods[collectionSize-2].Status.Conditions = []api.PodCondition{}
update(t, dc.podLister.Indexer, pods[collectionSize-2])
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, false, minimumTwo, minimumTwo, 2*collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 0, minimumTwo, minimumTwo, 2*collectionSize)
pods[collectionSize-1].Status.Conditions = []api.PodCondition{{Type: api.PodReady, Status: api.ConditionTrue}}
update(t, dc.podLister.Indexer, pods[collectionSize-1])
dc.sync(pdbName)
- ps.VerifyPdbStatus(t, pdbName, true, 1+minimumTwo, minimumTwo, 2*collectionSize)
+ ps.VerifyPdbStatus(t, pdbName, 1, 1+minimumTwo, minimumTwo, 2*collectionSize)
}
// Test pdb doesn't exist
diff --git a/pkg/master/master.go b/pkg/master/master.go
index efa03973463..3e6c6cc46d6 100644
--- a/pkg/master/master.go
+++ b/pkg/master/master.go
@@ -32,7 +32,7 @@ import (
batchapiv1 "k8s.io/kubernetes/pkg/apis/batch/v1"
certificatesapiv1alpha1 "k8s.io/kubernetes/pkg/apis/certificates/v1alpha1"
extensionsapiv1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
- policyapiv1alpha1 "k8s.io/kubernetes/pkg/apis/policy/v1alpha1"
+ policyapiv1beta1 "k8s.io/kubernetes/pkg/apis/policy/v1beta1"
rbacapi "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1"
storageapiv1beta1 "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
coreclient "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/internalversion"
@@ -347,7 +347,7 @@ func DefaultAPIResourceConfigSource() *genericapiserver.ResourceConfig {
authenticationv1beta1.SchemeGroupVersion,
autoscalingapiv1.SchemeGroupVersion,
appsapi.SchemeGroupVersion,
- policyapiv1alpha1.SchemeGroupVersion,
+ policyapiv1beta1.SchemeGroupVersion,
rbacapi.SchemeGroupVersion,
storageapiv1beta1.SchemeGroupVersion,
certificatesapiv1alpha1.SchemeGroupVersion,
diff --git a/pkg/registry/core/pod/etcd/eviction.go b/pkg/registry/core/pod/etcd/eviction.go
index 4dc1c7a965f..f7b3042ccc0 100644
--- a/pkg/registry/core/pod/etcd/eviction.go
+++ b/pkg/registry/core/pod/etcd/eviction.go
@@ -17,6 +17,8 @@ limitations under the License.
package etcd
import (
+ "fmt"
+
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/api/unversioned"
@@ -103,11 +105,13 @@ func (r *EvictionREST) Create(ctx api.Context, obj runtime.Object) (runtime.Obje
}
func (r *EvictionREST) checkAndDecrement(namespace string, pdb policy.PodDisruptionBudget) (ok bool, err error) {
- if !pdb.Status.PodDisruptionAllowed {
+ if pdb.Status.PodDisruptionsAllowed < 0 {
+ return false, fmt.Errorf("pdb disruptions allowed is negative")
+ }
+ if pdb.Status.PodDisruptionsAllowed == 0 {
return false, nil
}
-
- pdb.Status.PodDisruptionAllowed = false
+ pdb.Status.PodDisruptionsAllowed--
if _, err := r.podDisruptionBudgetClient.PodDisruptionBudgets(namespace).UpdateStatus(&pdb); err != nil {
return false, err
}
diff --git a/pkg/registry/core/rest/storage_core.go b/pkg/registry/core/rest/storage_core.go
index c919879e5cd..afc83777307 100644
--- a/pkg/registry/core/rest/storage_core.go
+++ b/pkg/registry/core/rest/storage_core.go
@@ -108,7 +108,7 @@ func (c LegacyRESTStorageProvider) NewLegacyRESTStorage(restOptionsGetter generi
}
var podDisruptionClient policyclient.PodDisruptionBudgetsGetter
- if policyGroupVersion := (unversioned.GroupVersion{Group: "policy", Version: "v1alpha1"}); registered.IsEnabledVersion(policyGroupVersion) {
+ if policyGroupVersion := (unversioned.GroupVersion{Group: "policy", Version: "v1beta1"}); registered.IsEnabledVersion(policyGroupVersion) {
apiGroupInfo.SubresourceGroupVersionKind["pods/eviction"] = policyGroupVersion.WithKind("Eviction")
var err error
@@ -234,7 +234,7 @@ func (c LegacyRESTStorageProvider) NewLegacyRESTStorage(restOptionsGetter generi
if registered.IsEnabledVersion(unversioned.GroupVersion{Group: "autoscaling", Version: "v1"}) {
restStorageMap["replicationControllers/scale"] = controllerStorage.Scale
}
- if registered.IsEnabledVersion(unversioned.GroupVersion{Group: "policy", Version: "v1alpha1"}) {
+ if registered.IsEnabledVersion(unversioned.GroupVersion{Group: "policy", Version: "v1beta1"}) {
restStorageMap["pods/eviction"] = podStorage.Eviction
}
apiGroupInfo.VersionedResourcesStorageMap["v1"] = restStorageMap
diff --git a/pkg/registry/policy/poddisruptionbudget/strategy_test.go b/pkg/registry/policy/poddisruptionbudget/strategy_test.go
index 3b56de607ea..84e8413e62d 100644
--- a/pkg/registry/policy/poddisruptionbudget/strategy_test.go
+++ b/pkg/registry/policy/poddisruptionbudget/strategy_test.go
@@ -53,10 +53,10 @@ func TestPodDisruptionBudgetStrategy(t *testing.T) {
ObjectMeta: api.ObjectMeta{Name: pdb.Name, Namespace: pdb.Namespace},
Spec: pdb.Spec,
Status: policy.PodDisruptionBudgetStatus{
- PodDisruptionAllowed: true,
- CurrentHealthy: 3,
- DesiredHealthy: 3,
- ExpectedPods: 3,
+ PodDisruptionsAllowed: 1,
+ CurrentHealthy: 3,
+ DesiredHealthy: 3,
+ ExpectedPods: 3,
},
}
@@ -101,10 +101,10 @@ func TestPodDisruptionBudgetStatusStrategy(t *testing.T) {
MinAvailable: intstr.FromInt(3),
},
Status: policy.PodDisruptionBudgetStatus{
- PodDisruptionAllowed: true,
- CurrentHealthy: 3,
- DesiredHealthy: 3,
- ExpectedPods: 3,
+ PodDisruptionsAllowed: 1,
+ CurrentHealthy: 3,
+ DesiredHealthy: 3,
+ ExpectedPods: 3,
},
}
newPdb := &policy.PodDisruptionBudget{
@@ -114,10 +114,10 @@ func TestPodDisruptionBudgetStatusStrategy(t *testing.T) {
MinAvailable: intstr.FromInt(2),
},
Status: policy.PodDisruptionBudgetStatus{
- PodDisruptionAllowed: false,
- CurrentHealthy: 2,
- DesiredHealthy: 3,
- ExpectedPods: 3,
+ PodDisruptionsAllowed: 0,
+ CurrentHealthy: 2,
+ DesiredHealthy: 3,
+ ExpectedPods: 3,
},
}
StatusStrategy.PrepareForUpdate(ctx, newPdb, oldPdb)
diff --git a/pkg/registry/policy/rest/storage_policy.go b/pkg/registry/policy/rest/storage_policy.go
index 6af4d08363a..cd70b38c446 100644
--- a/pkg/registry/policy/rest/storage_policy.go
+++ b/pkg/registry/policy/rest/storage_policy.go
@@ -19,7 +19,7 @@ package rest
import (
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/apis/policy"
- policyapiv1alpha1 "k8s.io/kubernetes/pkg/apis/policy/v1alpha1"
+ policyapiv1beta1 "k8s.io/kubernetes/pkg/apis/policy/v1beta1"
"k8s.io/kubernetes/pkg/genericapiserver"
poddisruptionbudgetetcd "k8s.io/kubernetes/pkg/registry/policy/poddisruptionbudget/etcd"
)
@@ -31,17 +31,15 @@ var _ genericapiserver.RESTStorageProvider = &RESTStorageProvider{}
func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter genericapiserver.RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool) {
apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(policy.GroupName)
- if apiResourceConfigSource.AnyResourcesForVersionEnabled(policyapiv1alpha1.SchemeGroupVersion) {
- apiGroupInfo.VersionedResourcesStorageMap[policyapiv1alpha1.SchemeGroupVersion.Version] = p.v1alpha1Storage(apiResourceConfigSource, restOptionsGetter)
- apiGroupInfo.GroupMeta.GroupVersion = policyapiv1alpha1.SchemeGroupVersion
+ if apiResourceConfigSource.AnyResourcesForVersionEnabled(policyapiv1beta1.SchemeGroupVersion) {
+ apiGroupInfo.VersionedResourcesStorageMap[policyapiv1beta1.SchemeGroupVersion.Version] = p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)
+ apiGroupInfo.GroupMeta.GroupVersion = policyapiv1beta1.SchemeGroupVersion
}
-
return apiGroupInfo, true
}
-func (p RESTStorageProvider) v1alpha1Storage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter genericapiserver.RESTOptionsGetter) map[string]rest.Storage {
- version := policyapiv1alpha1.SchemeGroupVersion
-
+func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter genericapiserver.RESTOptionsGetter) map[string]rest.Storage {
+ version := policyapiv1beta1.SchemeGroupVersion
storage := map[string]rest.Storage{}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("poddisruptionbudgets")) {
poddisruptionbudgetStorage, poddisruptionbudgetStatusStorage := poddisruptionbudgetetcd.NewREST(restOptionsGetter(policy.Resource("poddisruptionbudgets")))
diff --git a/test/e2e/disruption.go b/test/e2e/disruption.go
index 8001f3b2ad1..fe2953721b8 100644
--- a/test/e2e/disruption.go
+++ b/test/e2e/disruption.go
@@ -26,7 +26,7 @@ import (
"k8s.io/client-go/pkg/api/unversioned"
api "k8s.io/client-go/pkg/api/v1"
extensions "k8s.io/client-go/pkg/apis/extensions/v1beta1"
- policy "k8s.io/client-go/pkg/apis/policy/v1alpha1"
+ policy "k8s.io/client-go/pkg/apis/policy/v1beta1"
"k8s.io/client-go/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework"
From 6c58c1e7bb755e9dcf7456d908cbbd33f82488fb Mon Sep 17 00:00:00 2001
From: Marcin
Date: Wed, 26 Oct 2016 10:48:18 +0200
Subject: [PATCH 2/6] Delete generated code from policy/v1alpha1
---
pkg/apis/policy/v1alpha1/BUILD | 5 -
pkg/apis/policy/v1alpha1/generated.pb.go | 1191 -----------
pkg/apis/policy/v1alpha1/types.generated.go | 1752 -----------------
.../policy/v1alpha1/zz_generated.deepcopy.go | 133 --
4 files changed, 3081 deletions(-)
delete mode 100644 pkg/apis/policy/v1alpha1/generated.pb.go
delete mode 100644 pkg/apis/policy/v1alpha1/types.generated.go
delete mode 100644 pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go
diff --git a/pkg/apis/policy/v1alpha1/BUILD b/pkg/apis/policy/v1alpha1/BUILD
index 450bc576bb0..5267a8f2aab 100644
--- a/pkg/apis/policy/v1alpha1/BUILD
+++ b/pkg/apis/policy/v1alpha1/BUILD
@@ -14,13 +14,8 @@ go_library(
name = "go_default_library",
srcs = [
"doc.go",
- "generated.pb.go",
"register.go",
- "types.generated.go",
"types.go",
- "types_swagger_doc_generated.go",
- "zz_generated.conversion.go",
- "zz_generated.deepcopy.go",
],
tags = ["automanaged"],
deps = [
diff --git a/pkg/apis/policy/v1alpha1/generated.pb.go b/pkg/apis/policy/v1alpha1/generated.pb.go
deleted file mode 100644
index f16f7e23db2..00000000000
--- a/pkg/apis/policy/v1alpha1/generated.pb.go
+++ /dev/null
@@ -1,1191 +0,0 @@
-/*
-Copyright 2016 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by protoc-gen-gogo.
-// source: k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto
-// DO NOT EDIT!
-
-/*
- Package v1alpha1 is a generated protocol buffer package.
-
- It is generated from these files:
- k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto
-
- It has these top-level messages:
- Eviction
- PodDisruptionBudget
- PodDisruptionBudgetList
- PodDisruptionBudgetSpec
- PodDisruptionBudgetStatus
-*/
-package v1alpha1
-
-import proto "github.com/gogo/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-import k8s_io_kubernetes_pkg_api_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
-import k8s_io_kubernetes_pkg_api_v1 "k8s.io/kubernetes/pkg/api/v1"
-
-import strings "strings"
-import reflect "reflect"
-
-import io "io"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-const _ = proto.GoGoProtoPackageIsVersion1
-
-func (m *Eviction) Reset() { *m = Eviction{} }
-func (*Eviction) ProtoMessage() {}
-func (*Eviction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
-
-func (m *PodDisruptionBudget) Reset() { *m = PodDisruptionBudget{} }
-func (*PodDisruptionBudget) ProtoMessage() {}
-func (*PodDisruptionBudget) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
-
-func (m *PodDisruptionBudgetList) Reset() { *m = PodDisruptionBudgetList{} }
-func (*PodDisruptionBudgetList) ProtoMessage() {}
-func (*PodDisruptionBudgetList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }
-
-func (m *PodDisruptionBudgetSpec) Reset() { *m = PodDisruptionBudgetSpec{} }
-func (*PodDisruptionBudgetSpec) ProtoMessage() {}
-func (*PodDisruptionBudgetSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} }
-
-func (m *PodDisruptionBudgetStatus) Reset() { *m = PodDisruptionBudgetStatus{} }
-func (*PodDisruptionBudgetStatus) ProtoMessage() {}
-func (*PodDisruptionBudgetStatus) Descriptor() ([]byte, []int) {
- return fileDescriptorGenerated, []int{4}
-}
-
-func init() {
- proto.RegisterType((*Eviction)(nil), "k8s.io.kubernetes.pkg.apis.policy.v1alpha1.Eviction")
- proto.RegisterType((*PodDisruptionBudget)(nil), "k8s.io.kubernetes.pkg.apis.policy.v1alpha1.PodDisruptionBudget")
- proto.RegisterType((*PodDisruptionBudgetList)(nil), "k8s.io.kubernetes.pkg.apis.policy.v1alpha1.PodDisruptionBudgetList")
- proto.RegisterType((*PodDisruptionBudgetSpec)(nil), "k8s.io.kubernetes.pkg.apis.policy.v1alpha1.PodDisruptionBudgetSpec")
- proto.RegisterType((*PodDisruptionBudgetStatus)(nil), "k8s.io.kubernetes.pkg.apis.policy.v1alpha1.PodDisruptionBudgetStatus")
-}
-func (m *Eviction) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
-}
-
-func (m *Eviction) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- data[i] = 0xa
- i++
- i = encodeVarintGenerated(data, i, uint64(m.ObjectMeta.Size()))
- n1, err := m.ObjectMeta.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n1
- if m.DeleteOptions != nil {
- data[i] = 0x12
- i++
- i = encodeVarintGenerated(data, i, uint64(m.DeleteOptions.Size()))
- n2, err := m.DeleteOptions.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n2
- }
- return i, nil
-}
-
-func (m *PodDisruptionBudget) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
-}
-
-func (m *PodDisruptionBudget) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- data[i] = 0xa
- i++
- i = encodeVarintGenerated(data, i, uint64(m.ObjectMeta.Size()))
- n3, err := m.ObjectMeta.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n3
- data[i] = 0x12
- i++
- i = encodeVarintGenerated(data, i, uint64(m.Spec.Size()))
- n4, err := m.Spec.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n4
- data[i] = 0x1a
- i++
- i = encodeVarintGenerated(data, i, uint64(m.Status.Size()))
- n5, err := m.Status.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n5
- return i, nil
-}
-
-func (m *PodDisruptionBudgetList) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
-}
-
-func (m *PodDisruptionBudgetList) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- data[i] = 0xa
- i++
- i = encodeVarintGenerated(data, i, uint64(m.ListMeta.Size()))
- n6, err := m.ListMeta.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n6
- if len(m.Items) > 0 {
- for _, msg := range m.Items {
- data[i] = 0x12
- i++
- i = encodeVarintGenerated(data, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- return i, nil
-}
-
-func (m *PodDisruptionBudgetSpec) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
-}
-
-func (m *PodDisruptionBudgetSpec) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- data[i] = 0xa
- i++
- i = encodeVarintGenerated(data, i, uint64(m.MinAvailable.Size()))
- n7, err := m.MinAvailable.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n7
- if m.Selector != nil {
- data[i] = 0x12
- i++
- i = encodeVarintGenerated(data, i, uint64(m.Selector.Size()))
- n8, err := m.Selector.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n8
- }
- return i, nil
-}
-
-func (m *PodDisruptionBudgetStatus) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
-}
-
-func (m *PodDisruptionBudgetStatus) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- data[i] = 0x8
- i++
- if m.PodDisruptionAllowed {
- data[i] = 1
- } else {
- data[i] = 0
- }
- i++
- data[i] = 0x10
- i++
- i = encodeVarintGenerated(data, i, uint64(m.CurrentHealthy))
- data[i] = 0x18
- i++
- i = encodeVarintGenerated(data, i, uint64(m.DesiredHealthy))
- data[i] = 0x20
- i++
- i = encodeVarintGenerated(data, i, uint64(m.ExpectedPods))
- return i, nil
-}
-
-func encodeFixed64Generated(data []byte, offset int, v uint64) int {
- data[offset] = uint8(v)
- data[offset+1] = uint8(v >> 8)
- data[offset+2] = uint8(v >> 16)
- data[offset+3] = uint8(v >> 24)
- data[offset+4] = uint8(v >> 32)
- data[offset+5] = uint8(v >> 40)
- data[offset+6] = uint8(v >> 48)
- data[offset+7] = uint8(v >> 56)
- return offset + 8
-}
-func encodeFixed32Generated(data []byte, offset int, v uint32) int {
- data[offset] = uint8(v)
- data[offset+1] = uint8(v >> 8)
- data[offset+2] = uint8(v >> 16)
- data[offset+3] = uint8(v >> 24)
- return offset + 4
-}
-func encodeVarintGenerated(data []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- data[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- data[offset] = uint8(v)
- return offset + 1
-}
-func (m *Eviction) Size() (n int) {
- var l int
- _ = l
- l = m.ObjectMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if m.DeleteOptions != nil {
- l = m.DeleteOptions.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
-func (m *PodDisruptionBudget) Size() (n int) {
- var l int
- _ = l
- l = m.ObjectMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = m.Spec.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = m.Status.Size()
- n += 1 + l + sovGenerated(uint64(l))
- return n
-}
-
-func (m *PodDisruptionBudgetList) Size() (n int) {
- var l int
- _ = l
- l = m.ListMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if len(m.Items) > 0 {
- for _, e := range m.Items {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *PodDisruptionBudgetSpec) Size() (n int) {
- var l int
- _ = l
- l = m.MinAvailable.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if m.Selector != nil {
- l = m.Selector.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
-func (m *PodDisruptionBudgetStatus) Size() (n int) {
- var l int
- _ = l
- n += 2
- n += 1 + sovGenerated(uint64(m.CurrentHealthy))
- n += 1 + sovGenerated(uint64(m.DesiredHealthy))
- n += 1 + sovGenerated(uint64(m.ExpectedPods))
- return n
-}
-
-func sovGenerated(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
-}
-func sozGenerated(x uint64) (n int) {
- return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Eviction) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Eviction{`,
- `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
- `DeleteOptions:` + strings.Replace(fmt.Sprintf("%v", this.DeleteOptions), "DeleteOptions", "k8s_io_kubernetes_pkg_api_v1.DeleteOptions", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PodDisruptionBudget) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PodDisruptionBudget{`,
- `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
- `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodDisruptionBudgetSpec", "PodDisruptionBudgetSpec", 1), `&`, ``, 1) + `,`,
- `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodDisruptionBudgetStatus", "PodDisruptionBudgetStatus", 1), `&`, ``, 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PodDisruptionBudgetList) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PodDisruptionBudgetList{`,
- `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_kubernetes_pkg_api_unversioned.ListMeta", 1), `&`, ``, 1) + `,`,
- `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "PodDisruptionBudget", "PodDisruptionBudget", 1), `&`, ``, 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PodDisruptionBudgetSpec) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PodDisruptionBudgetSpec{`,
- `MinAvailable:` + strings.Replace(strings.Replace(this.MinAvailable.String(), "IntOrString", "k8s_io_kubernetes_pkg_util_intstr.IntOrString", 1), `&`, ``, 1) + `,`,
- `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_kubernetes_pkg_api_unversioned.LabelSelector", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PodDisruptionBudgetStatus) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PodDisruptionBudgetStatus{`,
- `PodDisruptionAllowed:` + fmt.Sprintf("%v", this.PodDisruptionAllowed) + `,`,
- `CurrentHealthy:` + fmt.Sprintf("%v", this.CurrentHealthy) + `,`,
- `DesiredHealthy:` + fmt.Sprintf("%v", this.DesiredHealthy) + `,`,
- `ExpectedPods:` + fmt.Sprintf("%v", this.ExpectedPods) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringGenerated(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Eviction) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: Eviction: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Eviction: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.ObjectMeta.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DeleteOptions", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.DeleteOptions == nil {
- m.DeleteOptions = &k8s_io_kubernetes_pkg_api_v1.DeleteOptions{}
- }
- if err := m.DeleteOptions.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PodDisruptionBudget) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: PodDisruptionBudget: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PodDisruptionBudget: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.ObjectMeta.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Spec.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Status.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PodDisruptionBudgetList) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: PodDisruptionBudgetList: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PodDisruptionBudgetList: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.ListMeta.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Items = append(m.Items, PodDisruptionBudget{})
- if err := m.Items[len(m.Items)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PodDisruptionBudgetSpec) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: PodDisruptionBudgetSpec: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PodDisruptionBudgetSpec: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field MinAvailable", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.MinAvailable.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Selector == nil {
- m.Selector = &k8s_io_kubernetes_pkg_api_unversioned.LabelSelector{}
- }
- if err := m.Selector.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PodDisruptionBudgetStatus) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: PodDisruptionBudgetStatus: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PodDisruptionBudgetStatus: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field PodDisruptionAllowed", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- v |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.PodDisruptionAllowed = bool(v != 0)
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field CurrentHealthy", wireType)
- }
- m.CurrentHealthy = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.CurrentHealthy |= (int32(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field DesiredHealthy", wireType)
- }
- m.DesiredHealthy = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.DesiredHealthy |= (int32(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExpectedPods", wireType)
- }
- m.ExpectedPods = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.ExpectedPods |= (int32(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipGenerated(data []byte) (n int, err error) {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if data[iNdEx-1] < 0x80 {
- break
- }
- }
- return iNdEx, nil
- case 1:
- iNdEx += 8
- return iNdEx, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- iNdEx += length
- if length < 0 {
- return 0, ErrInvalidLengthGenerated
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := skipGenerated(data[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- }
- return iNdEx, nil
- case 4:
- return iNdEx, nil
- case 5:
- iNdEx += 4
- return iNdEx, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
-}
-
-var (
- ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
-)
-
-var fileDescriptorGenerated = []byte{
- // 654 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x93, 0xdd, 0x6a, 0x13, 0x41,
- 0x14, 0xc7, 0xb3, 0xfd, 0x22, 0x4c, 0xd3, 0x62, 0xd7, 0xa2, 0x31, 0xc8, 0x56, 0x72, 0x55, 0xaa,
- 0x9d, 0x25, 0x45, 0xa1, 0x78, 0xa1, 0x74, 0xdb, 0x82, 0x15, 0x4b, 0xcb, 0xf6, 0x46, 0x04, 0x85,
- 0xc9, 0xce, 0x71, 0x33, 0x66, 0xb3, 0xb3, 0xcc, 0xcc, 0x46, 0x7b, 0xe7, 0x23, 0xf8, 0x0a, 0x3e,
- 0x8c, 0x50, 0xbc, 0xea, 0xa5, 0x57, 0xc1, 0xa4, 0x2f, 0x22, 0x3b, 0x99, 0xa4, 0xd9, 0x7c, 0x94,
- 0x42, 0xf1, 0x6e, 0xcf, 0xcc, 0xf9, 0xfd, 0xff, 0xe7, 0x9c, 0x3d, 0x83, 0x5e, 0x36, 0x77, 0x25,
- 0x66, 0xdc, 0x6d, 0xa6, 0x75, 0x10, 0x31, 0x28, 0x90, 0x6e, 0xd2, 0x0c, 0x5d, 0x92, 0x30, 0xe9,
- 0x26, 0x3c, 0x62, 0xc1, 0xb9, 0xdb, 0xae, 0x91, 0x28, 0x69, 0x90, 0x9a, 0x1b, 0x42, 0x0c, 0x82,
- 0x28, 0xa0, 0x38, 0x11, 0x5c, 0x71, 0x7b, 0xab, 0xcf, 0xe2, 0x6b, 0x16, 0x27, 0xcd, 0x10, 0x67,
- 0x2c, 0xee, 0xb3, 0x78, 0xc0, 0x56, 0xb6, 0x43, 0xa6, 0x1a, 0x69, 0x1d, 0x07, 0xbc, 0xe5, 0x86,
- 0x3c, 0xe4, 0xae, 0x96, 0xa8, 0xa7, 0x9f, 0x75, 0xa4, 0x03, 0xfd, 0xd5, 0x97, 0xae, 0xec, 0xcc,
- 0x2c, 0xcb, 0x15, 0x20, 0x79, 0x2a, 0x02, 0x18, 0x2f, 0xa7, 0xf2, 0x62, 0x36, 0x93, 0xc6, 0x6d,
- 0x10, 0x92, 0xf1, 0x18, 0xe8, 0x04, 0xf6, 0x6c, 0x36, 0xd6, 0x9e, 0xe8, 0xb9, 0xb2, 0x3d, 0x3d,
- 0x5b, 0xa4, 0xb1, 0x62, 0xad, 0xc9, 0x9a, 0x6a, 0xd3, 0xd3, 0x53, 0xc5, 0x22, 0x97, 0xc5, 0x4a,
- 0x2a, 0x31, 0x8e, 0x54, 0x7f, 0x5b, 0xa8, 0x78, 0xd8, 0x66, 0x81, 0x62, 0x3c, 0xb6, 0xdf, 0xa3,
- 0x62, 0x0b, 0x14, 0xa1, 0x44, 0x91, 0xb2, 0xf5, 0xc4, 0xda, 0x5c, 0xde, 0xd9, 0xc4, 0x33, 0xa7,
- 0x8e, 0xdb, 0x35, 0x7c, 0x52, 0xff, 0x02, 0x81, 0x3a, 0x06, 0x45, 0x3c, 0xfb, 0xa2, 0xb3, 0x51,
- 0xe8, 0x75, 0x36, 0xd0, 0xf5, 0x99, 0x3f, 0x54, 0xb3, 0x29, 0x5a, 0xa1, 0x10, 0x81, 0x82, 0x93,
- 0x24, 0x73, 0x92, 0xe5, 0x39, 0x2d, 0xff, 0xf4, 0x66, 0xf9, 0x83, 0x51, 0xc4, 0x5b, 0xeb, 0x75,
- 0x36, 0x56, 0x72, 0x47, 0x7e, 0x5e, 0xb4, 0xfa, 0x6b, 0x0e, 0xdd, 0x3f, 0xe5, 0xf4, 0x80, 0x49,
- 0x91, 0xea, 0x23, 0x2f, 0xa5, 0x21, 0xa8, 0xff, 0xd8, 0x17, 0xa0, 0x05, 0x99, 0x40, 0x60, 0xda,
- 0xd9, 0xc7, 0xb7, 0xdf, 0x51, 0x3c, 0xa5, 0xd0, 0xb3, 0x04, 0x02, 0xaf, 0x64, 0x0c, 0x17, 0xb2,
- 0xc8, 0xd7, 0xf2, 0x76, 0x0b, 0x2d, 0x49, 0x45, 0x54, 0x2a, 0xcb, 0xf3, 0xda, 0xe8, 0xf0, 0xae,
- 0x46, 0x5a, 0xcc, 0x5b, 0x35, 0x56, 0x4b, 0xfd, 0xd8, 0x37, 0x26, 0xd5, 0x8e, 0x85, 0x1e, 0x4e,
- 0xa1, 0xde, 0x31, 0xa9, 0xec, 0x8f, 0x13, 0xb3, 0x74, 0x6f, 0x98, 0xe5, 0xc8, 0x53, 0xc0, 0x19,
- 0xae, 0x47, 0x7a, 0xcf, 0xd8, 0x16, 0x07, 0x27, 0xb9, 0x45, 0x59, 0x64, 0x0a, 0x5a, 0xd9, 0x82,
- 0xcc, 0x6f, 0x2e, 0xef, 0xbc, 0xbe, 0x63, 0xa3, 0xde, 0x8a, 0xf1, 0x5a, 0x3c, 0xca, 0x54, 0xfd,
- 0xbe, 0x78, 0xf5, 0x6a, 0x7a, 0x83, 0xd9, 0xc4, 0xed, 0x06, 0x2a, 0xb5, 0x58, 0xbc, 0xd7, 0x26,
- 0x2c, 0x22, 0xf5, 0x08, 0x4c, 0x93, 0x78, 0x46, 0x21, 0xd9, 0xdb, 0xc2, 0xfd, 0xb7, 0x85, 0x8f,
- 0x62, 0x75, 0x22, 0xce, 0x94, 0x60, 0x71, 0xe8, 0xad, 0x1b, 0xdf, 0xd2, 0xf1, 0x88, 0x96, 0x9f,
- 0x53, 0xb6, 0x3f, 0xa1, 0xa2, 0x84, 0x08, 0x02, 0xc5, 0x85, 0x59, 0xa0, 0xe7, 0xb7, 0x1d, 0x25,
- 0xa9, 0x43, 0x74, 0x66, 0x58, 0xaf, 0x94, 0xcd, 0x72, 0x10, 0xf9, 0x43, 0xcd, 0xea, 0xcf, 0x39,
- 0xf4, 0x68, 0xe6, 0xcf, 0xb7, 0xdf, 0xa2, 0x35, 0x3a, 0xbc, 0xd9, 0x8b, 0x22, 0xfe, 0x15, 0xa8,
- 0x6e, 0xb6, 0xe8, 0x3d, 0x36, 0xc5, 0xaf, 0xe7, 0x68, 0x93, 0xe3, 0x4f, 0x62, 0xf6, 0x2b, 0xb4,
- 0x1a, 0xa4, 0x42, 0x40, 0xac, 0xde, 0x00, 0x89, 0x54, 0xe3, 0x5c, 0xf7, 0xb3, 0xe8, 0x3d, 0x30,
- 0x42, 0xab, 0xfb, 0xb9, 0x5b, 0x7f, 0x2c, 0x3b, 0xe3, 0x29, 0x48, 0x26, 0x80, 0x0e, 0xf8, 0xf9,
- 0x3c, 0x7f, 0x90, 0xbb, 0xf5, 0xc7, 0xb2, 0xed, 0x5d, 0x54, 0x82, 0x6f, 0x09, 0x04, 0x0a, 0xe8,
- 0x29, 0xa7, 0xb2, 0xbc, 0xa0, 0xe9, 0xe1, 0x3f, 0x38, 0x1c, 0xb9, 0xf3, 0x73, 0x99, 0xde, 0xd6,
- 0x45, 0xd7, 0x29, 0x5c, 0x76, 0x9d, 0xc2, 0x9f, 0xae, 0x53, 0xf8, 0xde, 0x73, 0xac, 0x8b, 0x9e,
- 0x63, 0x5d, 0xf6, 0x1c, 0xeb, 0x6f, 0xcf, 0xb1, 0x7e, 0x5c, 0x39, 0x85, 0x0f, 0xc5, 0xc1, 0x7e,
- 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xdd, 0x26, 0x2d, 0xbe, 0x06, 0x00, 0x00,
-}
diff --git a/pkg/apis/policy/v1alpha1/types.generated.go b/pkg/apis/policy/v1alpha1/types.generated.go
deleted file mode 100644
index b131cdcf588..00000000000
--- a/pkg/apis/policy/v1alpha1/types.generated.go
+++ /dev/null
@@ -1,1752 +0,0 @@
-/*
-Copyright 2016 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// ************************************************************
-// DO NOT EDIT.
-// THIS FILE IS AUTO-GENERATED BY codecgen.
-// ************************************************************
-
-package v1alpha1
-
-import (
- "errors"
- "fmt"
- codec1978 "github.com/ugorji/go/codec"
- pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
- pkg3_v1 "k8s.io/kubernetes/pkg/api/v1"
- pkg4_types "k8s.io/kubernetes/pkg/types"
- pkg1_intstr "k8s.io/kubernetes/pkg/util/intstr"
- "reflect"
- "runtime"
- time "time"
-)
-
-const (
- // ----- content types ----
- codecSelferC_UTF81234 = 1
- codecSelferC_RAW1234 = 0
- // ----- value types used ----
- codecSelferValueTypeArray1234 = 10
- codecSelferValueTypeMap1234 = 9
- // ----- containerStateValues ----
- codecSelfer_containerMapKey1234 = 2
- codecSelfer_containerMapValue1234 = 3
- codecSelfer_containerMapEnd1234 = 4
- codecSelfer_containerArrayElem1234 = 6
- codecSelfer_containerArrayEnd1234 = 7
-)
-
-var (
- codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits())
- codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`)
-)
-
-type codecSelfer1234 struct{}
-
-func init() {
- if codec1978.GenVersion != 5 {
- _, file, _, _ := runtime.Caller(0)
- err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v",
- 5, codec1978.GenVersion, file)
- panic(err)
- }
- if false { // reference the types, but skip this branch at build/run time
- var v0 pkg2_unversioned.LabelSelector
- var v1 pkg3_v1.ObjectMeta
- var v2 pkg4_types.UID
- var v3 pkg1_intstr.IntOrString
- var v4 time.Time
- _, _, _, _, _ = v0, v1, v2, v3, v4
- }
-}
-
-func (x *PodDisruptionBudgetSpec) CodecEncodeSelf(e *codec1978.Encoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperEncoder(e)
- _, _, _ = h, z, r
- if x == nil {
- r.EncodeNil()
- } else {
- yym1 := z.EncBinary()
- _ = yym1
- if false {
- } else if z.HasExtensions() && z.EncExt(x) {
- } else {
- yysep2 := !z.EncBinary()
- yy2arr2 := z.EncBasicHandle().StructToArray
- var yyq2 [2]bool
- _, _, _ = yysep2, yyq2, yy2arr2
- const yyr2 bool = false
- yyq2[0] = true
- yyq2[1] = x.Selector != nil
- var yynn2 int
- if yyr2 || yy2arr2 {
- r.EncodeArrayStart(2)
- } else {
- yynn2 = 0
- for _, b := range yyq2 {
- if b {
- yynn2++
- }
- }
- r.EncodeMapStart(yynn2)
- yynn2 = 0
- }
- if yyr2 || yy2arr2 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq2[0] {
- yy4 := &x.MinAvailable
- yym5 := z.EncBinary()
- _ = yym5
- if false {
- } else if z.HasExtensions() && z.EncExt(yy4) {
- } else if !yym5 && z.IsJSONHandle() {
- z.EncJSONMarshal(yy4)
- } else {
- z.EncFallback(yy4)
- }
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq2[0] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("minAvailable"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy6 := &x.MinAvailable
- yym7 := z.EncBinary()
- _ = yym7
- if false {
- } else if z.HasExtensions() && z.EncExt(yy6) {
- } else if !yym7 && z.IsJSONHandle() {
- z.EncJSONMarshal(yy6)
- } else {
- z.EncFallback(yy6)
- }
- }
- }
- if yyr2 || yy2arr2 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq2[1] {
- if x.Selector == nil {
- r.EncodeNil()
- } else {
- yym9 := z.EncBinary()
- _ = yym9
- if false {
- } else if z.HasExtensions() && z.EncExt(x.Selector) {
- } else {
- z.EncFallback(x.Selector)
- }
- }
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq2[1] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("selector"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- if x.Selector == nil {
- r.EncodeNil()
- } else {
- yym10 := z.EncBinary()
- _ = yym10
- if false {
- } else if z.HasExtensions() && z.EncExt(x.Selector) {
- } else {
- z.EncFallback(x.Selector)
- }
- }
- }
- }
- if yyr2 || yy2arr2 {
- z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- z.EncSendContainerState(codecSelfer_containerMapEnd1234)
- }
- }
- }
-}
-
-func (x *PodDisruptionBudgetSpec) CodecDecodeSelf(d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- yym11 := z.DecBinary()
- _ = yym11
- if false {
- } else if z.HasExtensions() && z.DecExt(x) {
- } else {
- yyct12 := r.ContainerType()
- if yyct12 == codecSelferValueTypeMap1234 {
- yyl12 := r.ReadMapStart()
- if yyl12 == 0 {
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
- } else {
- x.codecDecodeSelfFromMap(yyl12, d)
- }
- } else if yyct12 == codecSelferValueTypeArray1234 {
- yyl12 := r.ReadArrayStart()
- if yyl12 == 0 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- x.codecDecodeSelfFromArray(yyl12, d)
- }
- } else {
- panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
- }
- }
-}
-
-func (x *PodDisruptionBudgetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yys13Slc = z.DecScratchBuffer() // default slice to decode into
- _ = yys13Slc
- var yyhl13 bool = l >= 0
- for yyj13 := 0; ; yyj13++ {
- if yyhl13 {
- if yyj13 >= l {
- break
- }
- } else {
- if r.CheckBreak() {
- break
- }
- }
- z.DecSendContainerState(codecSelfer_containerMapKey1234)
- yys13Slc = r.DecodeBytes(yys13Slc, true, true)
- yys13 := string(yys13Slc)
- z.DecSendContainerState(codecSelfer_containerMapValue1234)
- switch yys13 {
- case "minAvailable":
- if r.TryDecodeAsNil() {
- x.MinAvailable = pkg1_intstr.IntOrString{}
- } else {
- yyv14 := &x.MinAvailable
- yym15 := z.DecBinary()
- _ = yym15
- if false {
- } else if z.HasExtensions() && z.DecExt(yyv14) {
- } else if !yym15 && z.IsJSONHandle() {
- z.DecJSONUnmarshal(yyv14)
- } else {
- z.DecFallback(yyv14, false)
- }
- }
- case "selector":
- if r.TryDecodeAsNil() {
- if x.Selector != nil {
- x.Selector = nil
- }
- } else {
- if x.Selector == nil {
- x.Selector = new(pkg2_unversioned.LabelSelector)
- }
- yym17 := z.DecBinary()
- _ = yym17
- if false {
- } else if z.HasExtensions() && z.DecExt(x.Selector) {
- } else {
- z.DecFallback(x.Selector, false)
- }
- }
- default:
- z.DecStructFieldNotFound(-1, yys13)
- } // end switch yys13
- } // end for yyj13
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
-}
-
-func (x *PodDisruptionBudgetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yyj18 int
- var yyb18 bool
- var yyhl18 bool = l >= 0
- yyj18++
- if yyhl18 {
- yyb18 = yyj18 > l
- } else {
- yyb18 = r.CheckBreak()
- }
- if yyb18 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.MinAvailable = pkg1_intstr.IntOrString{}
- } else {
- yyv19 := &x.MinAvailable
- yym20 := z.DecBinary()
- _ = yym20
- if false {
- } else if z.HasExtensions() && z.DecExt(yyv19) {
- } else if !yym20 && z.IsJSONHandle() {
- z.DecJSONUnmarshal(yyv19)
- } else {
- z.DecFallback(yyv19, false)
- }
- }
- yyj18++
- if yyhl18 {
- yyb18 = yyj18 > l
- } else {
- yyb18 = r.CheckBreak()
- }
- if yyb18 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- if x.Selector != nil {
- x.Selector = nil
- }
- } else {
- if x.Selector == nil {
- x.Selector = new(pkg2_unversioned.LabelSelector)
- }
- yym22 := z.DecBinary()
- _ = yym22
- if false {
- } else if z.HasExtensions() && z.DecExt(x.Selector) {
- } else {
- z.DecFallback(x.Selector, false)
- }
- }
- for {
- yyj18++
- if yyhl18 {
- yyb18 = yyj18 > l
- } else {
- yyb18 = r.CheckBreak()
- }
- if yyb18 {
- break
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj18-1, "")
- }
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
-}
-
-func (x *PodDisruptionBudgetStatus) CodecEncodeSelf(e *codec1978.Encoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperEncoder(e)
- _, _, _ = h, z, r
- if x == nil {
- r.EncodeNil()
- } else {
- yym23 := z.EncBinary()
- _ = yym23
- if false {
- } else if z.HasExtensions() && z.EncExt(x) {
- } else {
- yysep24 := !z.EncBinary()
- yy2arr24 := z.EncBasicHandle().StructToArray
- var yyq24 [4]bool
- _, _, _ = yysep24, yyq24, yy2arr24
- const yyr24 bool = false
- var yynn24 int
- if yyr24 || yy2arr24 {
- r.EncodeArrayStart(4)
- } else {
- yynn24 = 4
- for _, b := range yyq24 {
- if b {
- yynn24++
- }
- }
- r.EncodeMapStart(yynn24)
- yynn24 = 0
- }
- if yyr24 || yy2arr24 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yym26 := z.EncBinary()
- _ = yym26
- if false {
- } else {
- r.EncodeBool(bool(x.PodDisruptionAllowed))
- }
- } else {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("disruptionAllowed"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym27 := z.EncBinary()
- _ = yym27
- if false {
- } else {
- r.EncodeBool(bool(x.PodDisruptionAllowed))
- }
- }
- if yyr24 || yy2arr24 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yym29 := z.EncBinary()
- _ = yym29
- if false {
- } else {
- r.EncodeInt(int64(x.CurrentHealthy))
- }
- } else {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("currentHealthy"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym30 := z.EncBinary()
- _ = yym30
- if false {
- } else {
- r.EncodeInt(int64(x.CurrentHealthy))
- }
- }
- if yyr24 || yy2arr24 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yym32 := z.EncBinary()
- _ = yym32
- if false {
- } else {
- r.EncodeInt(int64(x.DesiredHealthy))
- }
- } else {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("desiredHealthy"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym33 := z.EncBinary()
- _ = yym33
- if false {
- } else {
- r.EncodeInt(int64(x.DesiredHealthy))
- }
- }
- if yyr24 || yy2arr24 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yym35 := z.EncBinary()
- _ = yym35
- if false {
- } else {
- r.EncodeInt(int64(x.ExpectedPods))
- }
- } else {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("expectedPods"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym36 := z.EncBinary()
- _ = yym36
- if false {
- } else {
- r.EncodeInt(int64(x.ExpectedPods))
- }
- }
- if yyr24 || yy2arr24 {
- z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- z.EncSendContainerState(codecSelfer_containerMapEnd1234)
- }
- }
- }
-}
-
-func (x *PodDisruptionBudgetStatus) CodecDecodeSelf(d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- yym37 := z.DecBinary()
- _ = yym37
- if false {
- } else if z.HasExtensions() && z.DecExt(x) {
- } else {
- yyct38 := r.ContainerType()
- if yyct38 == codecSelferValueTypeMap1234 {
- yyl38 := r.ReadMapStart()
- if yyl38 == 0 {
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
- } else {
- x.codecDecodeSelfFromMap(yyl38, d)
- }
- } else if yyct38 == codecSelferValueTypeArray1234 {
- yyl38 := r.ReadArrayStart()
- if yyl38 == 0 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- x.codecDecodeSelfFromArray(yyl38, d)
- }
- } else {
- panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
- }
- }
-}
-
-func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yys39Slc = z.DecScratchBuffer() // default slice to decode into
- _ = yys39Slc
- var yyhl39 bool = l >= 0
- for yyj39 := 0; ; yyj39++ {
- if yyhl39 {
- if yyj39 >= l {
- break
- }
- } else {
- if r.CheckBreak() {
- break
- }
- }
- z.DecSendContainerState(codecSelfer_containerMapKey1234)
- yys39Slc = r.DecodeBytes(yys39Slc, true, true)
- yys39 := string(yys39Slc)
- z.DecSendContainerState(codecSelfer_containerMapValue1234)
- switch yys39 {
- case "disruptionAllowed":
- if r.TryDecodeAsNil() {
- x.PodDisruptionAllowed = false
- } else {
- x.PodDisruptionAllowed = bool(r.DecodeBool())
- }
- case "currentHealthy":
- if r.TryDecodeAsNil() {
- x.CurrentHealthy = 0
- } else {
- x.CurrentHealthy = int32(r.DecodeInt(32))
- }
- case "desiredHealthy":
- if r.TryDecodeAsNil() {
- x.DesiredHealthy = 0
- } else {
- x.DesiredHealthy = int32(r.DecodeInt(32))
- }
- case "expectedPods":
- if r.TryDecodeAsNil() {
- x.ExpectedPods = 0
- } else {
- x.ExpectedPods = int32(r.DecodeInt(32))
- }
- default:
- z.DecStructFieldNotFound(-1, yys39)
- } // end switch yys39
- } // end for yyj39
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
-}
-
-func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yyj44 int
- var yyb44 bool
- var yyhl44 bool = l >= 0
- yyj44++
- if yyhl44 {
- yyb44 = yyj44 > l
- } else {
- yyb44 = r.CheckBreak()
- }
- if yyb44 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.PodDisruptionAllowed = false
- } else {
- x.PodDisruptionAllowed = bool(r.DecodeBool())
- }
- yyj44++
- if yyhl44 {
- yyb44 = yyj44 > l
- } else {
- yyb44 = r.CheckBreak()
- }
- if yyb44 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.CurrentHealthy = 0
- } else {
- x.CurrentHealthy = int32(r.DecodeInt(32))
- }
- yyj44++
- if yyhl44 {
- yyb44 = yyj44 > l
- } else {
- yyb44 = r.CheckBreak()
- }
- if yyb44 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.DesiredHealthy = 0
- } else {
- x.DesiredHealthy = int32(r.DecodeInt(32))
- }
- yyj44++
- if yyhl44 {
- yyb44 = yyj44 > l
- } else {
- yyb44 = r.CheckBreak()
- }
- if yyb44 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.ExpectedPods = 0
- } else {
- x.ExpectedPods = int32(r.DecodeInt(32))
- }
- for {
- yyj44++
- if yyhl44 {
- yyb44 = yyj44 > l
- } else {
- yyb44 = r.CheckBreak()
- }
- if yyb44 {
- break
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj44-1, "")
- }
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
-}
-
-func (x *PodDisruptionBudget) CodecEncodeSelf(e *codec1978.Encoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperEncoder(e)
- _, _, _ = h, z, r
- if x == nil {
- r.EncodeNil()
- } else {
- yym49 := z.EncBinary()
- _ = yym49
- if false {
- } else if z.HasExtensions() && z.EncExt(x) {
- } else {
- yysep50 := !z.EncBinary()
- yy2arr50 := z.EncBasicHandle().StructToArray
- var yyq50 [5]bool
- _, _, _ = yysep50, yyq50, yy2arr50
- const yyr50 bool = false
- yyq50[0] = x.Kind != ""
- yyq50[1] = x.APIVersion != ""
- yyq50[2] = true
- yyq50[3] = true
- yyq50[4] = true
- var yynn50 int
- if yyr50 || yy2arr50 {
- r.EncodeArrayStart(5)
- } else {
- yynn50 = 0
- for _, b := range yyq50 {
- if b {
- yynn50++
- }
- }
- r.EncodeMapStart(yynn50)
- yynn50 = 0
- }
- if yyr50 || yy2arr50 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq50[0] {
- yym52 := z.EncBinary()
- _ = yym52
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
- }
- } else {
- r.EncodeString(codecSelferC_UTF81234, "")
- }
- } else {
- if yyq50[0] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("kind"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym53 := z.EncBinary()
- _ = yym53
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
- }
- }
- }
- if yyr50 || yy2arr50 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq50[1] {
- yym55 := z.EncBinary()
- _ = yym55
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
- }
- } else {
- r.EncodeString(codecSelferC_UTF81234, "")
- }
- } else {
- if yyq50[1] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym56 := z.EncBinary()
- _ = yym56
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
- }
- }
- }
- if yyr50 || yy2arr50 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq50[2] {
- yy58 := &x.ObjectMeta
- yy58.CodecEncodeSelf(e)
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq50[2] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("metadata"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy59 := &x.ObjectMeta
- yy59.CodecEncodeSelf(e)
- }
- }
- if yyr50 || yy2arr50 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq50[3] {
- yy61 := &x.Spec
- yy61.CodecEncodeSelf(e)
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq50[3] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("spec"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy62 := &x.Spec
- yy62.CodecEncodeSelf(e)
- }
- }
- if yyr50 || yy2arr50 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq50[4] {
- yy64 := &x.Status
- yy64.CodecEncodeSelf(e)
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq50[4] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("status"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy65 := &x.Status
- yy65.CodecEncodeSelf(e)
- }
- }
- if yyr50 || yy2arr50 {
- z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- z.EncSendContainerState(codecSelfer_containerMapEnd1234)
- }
- }
- }
-}
-
-func (x *PodDisruptionBudget) CodecDecodeSelf(d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- yym66 := z.DecBinary()
- _ = yym66
- if false {
- } else if z.HasExtensions() && z.DecExt(x) {
- } else {
- yyct67 := r.ContainerType()
- if yyct67 == codecSelferValueTypeMap1234 {
- yyl67 := r.ReadMapStart()
- if yyl67 == 0 {
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
- } else {
- x.codecDecodeSelfFromMap(yyl67, d)
- }
- } else if yyct67 == codecSelferValueTypeArray1234 {
- yyl67 := r.ReadArrayStart()
- if yyl67 == 0 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- x.codecDecodeSelfFromArray(yyl67, d)
- }
- } else {
- panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
- }
- }
-}
-
-func (x *PodDisruptionBudget) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yys68Slc = z.DecScratchBuffer() // default slice to decode into
- _ = yys68Slc
- var yyhl68 bool = l >= 0
- for yyj68 := 0; ; yyj68++ {
- if yyhl68 {
- if yyj68 >= l {
- break
- }
- } else {
- if r.CheckBreak() {
- break
- }
- }
- z.DecSendContainerState(codecSelfer_containerMapKey1234)
- yys68Slc = r.DecodeBytes(yys68Slc, true, true)
- yys68 := string(yys68Slc)
- z.DecSendContainerState(codecSelfer_containerMapValue1234)
- switch yys68 {
- case "kind":
- if r.TryDecodeAsNil() {
- x.Kind = ""
- } else {
- x.Kind = string(r.DecodeString())
- }
- case "apiVersion":
- if r.TryDecodeAsNil() {
- x.APIVersion = ""
- } else {
- x.APIVersion = string(r.DecodeString())
- }
- case "metadata":
- if r.TryDecodeAsNil() {
- x.ObjectMeta = pkg3_v1.ObjectMeta{}
- } else {
- yyv71 := &x.ObjectMeta
- yyv71.CodecDecodeSelf(d)
- }
- case "spec":
- if r.TryDecodeAsNil() {
- x.Spec = PodDisruptionBudgetSpec{}
- } else {
- yyv72 := &x.Spec
- yyv72.CodecDecodeSelf(d)
- }
- case "status":
- if r.TryDecodeAsNil() {
- x.Status = PodDisruptionBudgetStatus{}
- } else {
- yyv73 := &x.Status
- yyv73.CodecDecodeSelf(d)
- }
- default:
- z.DecStructFieldNotFound(-1, yys68)
- } // end switch yys68
- } // end for yyj68
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
-}
-
-func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yyj74 int
- var yyb74 bool
- var yyhl74 bool = l >= 0
- yyj74++
- if yyhl74 {
- yyb74 = yyj74 > l
- } else {
- yyb74 = r.CheckBreak()
- }
- if yyb74 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.Kind = ""
- } else {
- x.Kind = string(r.DecodeString())
- }
- yyj74++
- if yyhl74 {
- yyb74 = yyj74 > l
- } else {
- yyb74 = r.CheckBreak()
- }
- if yyb74 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.APIVersion = ""
- } else {
- x.APIVersion = string(r.DecodeString())
- }
- yyj74++
- if yyhl74 {
- yyb74 = yyj74 > l
- } else {
- yyb74 = r.CheckBreak()
- }
- if yyb74 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.ObjectMeta = pkg3_v1.ObjectMeta{}
- } else {
- yyv77 := &x.ObjectMeta
- yyv77.CodecDecodeSelf(d)
- }
- yyj74++
- if yyhl74 {
- yyb74 = yyj74 > l
- } else {
- yyb74 = r.CheckBreak()
- }
- if yyb74 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.Spec = PodDisruptionBudgetSpec{}
- } else {
- yyv78 := &x.Spec
- yyv78.CodecDecodeSelf(d)
- }
- yyj74++
- if yyhl74 {
- yyb74 = yyj74 > l
- } else {
- yyb74 = r.CheckBreak()
- }
- if yyb74 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.Status = PodDisruptionBudgetStatus{}
- } else {
- yyv79 := &x.Status
- yyv79.CodecDecodeSelf(d)
- }
- for {
- yyj74++
- if yyhl74 {
- yyb74 = yyj74 > l
- } else {
- yyb74 = r.CheckBreak()
- }
- if yyb74 {
- break
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj74-1, "")
- }
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
-}
-
-func (x *PodDisruptionBudgetList) CodecEncodeSelf(e *codec1978.Encoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperEncoder(e)
- _, _, _ = h, z, r
- if x == nil {
- r.EncodeNil()
- } else {
- yym80 := z.EncBinary()
- _ = yym80
- if false {
- } else if z.HasExtensions() && z.EncExt(x) {
- } else {
- yysep81 := !z.EncBinary()
- yy2arr81 := z.EncBasicHandle().StructToArray
- var yyq81 [4]bool
- _, _, _ = yysep81, yyq81, yy2arr81
- const yyr81 bool = false
- yyq81[0] = x.Kind != ""
- yyq81[1] = x.APIVersion != ""
- yyq81[2] = true
- var yynn81 int
- if yyr81 || yy2arr81 {
- r.EncodeArrayStart(4)
- } else {
- yynn81 = 1
- for _, b := range yyq81 {
- if b {
- yynn81++
- }
- }
- r.EncodeMapStart(yynn81)
- yynn81 = 0
- }
- if yyr81 || yy2arr81 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq81[0] {
- yym83 := z.EncBinary()
- _ = yym83
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
- }
- } else {
- r.EncodeString(codecSelferC_UTF81234, "")
- }
- } else {
- if yyq81[0] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("kind"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym84 := z.EncBinary()
- _ = yym84
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
- }
- }
- }
- if yyr81 || yy2arr81 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq81[1] {
- yym86 := z.EncBinary()
- _ = yym86
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
- }
- } else {
- r.EncodeString(codecSelferC_UTF81234, "")
- }
- } else {
- if yyq81[1] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym87 := z.EncBinary()
- _ = yym87
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
- }
- }
- }
- if yyr81 || yy2arr81 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq81[2] {
- yy89 := &x.ListMeta
- yym90 := z.EncBinary()
- _ = yym90
- if false {
- } else if z.HasExtensions() && z.EncExt(yy89) {
- } else {
- z.EncFallback(yy89)
- }
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq81[2] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("metadata"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy91 := &x.ListMeta
- yym92 := z.EncBinary()
- _ = yym92
- if false {
- } else if z.HasExtensions() && z.EncExt(yy91) {
- } else {
- z.EncFallback(yy91)
- }
- }
- }
- if yyr81 || yy2arr81 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if x.Items == nil {
- r.EncodeNil()
- } else {
- yym94 := z.EncBinary()
- _ = yym94
- if false {
- } else {
- h.encSlicePodDisruptionBudget(([]PodDisruptionBudget)(x.Items), e)
- }
- }
- } else {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("items"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- if x.Items == nil {
- r.EncodeNil()
- } else {
- yym95 := z.EncBinary()
- _ = yym95
- if false {
- } else {
- h.encSlicePodDisruptionBudget(([]PodDisruptionBudget)(x.Items), e)
- }
- }
- }
- if yyr81 || yy2arr81 {
- z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- z.EncSendContainerState(codecSelfer_containerMapEnd1234)
- }
- }
- }
-}
-
-func (x *PodDisruptionBudgetList) CodecDecodeSelf(d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- yym96 := z.DecBinary()
- _ = yym96
- if false {
- } else if z.HasExtensions() && z.DecExt(x) {
- } else {
- yyct97 := r.ContainerType()
- if yyct97 == codecSelferValueTypeMap1234 {
- yyl97 := r.ReadMapStart()
- if yyl97 == 0 {
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
- } else {
- x.codecDecodeSelfFromMap(yyl97, d)
- }
- } else if yyct97 == codecSelferValueTypeArray1234 {
- yyl97 := r.ReadArrayStart()
- if yyl97 == 0 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- x.codecDecodeSelfFromArray(yyl97, d)
- }
- } else {
- panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
- }
- }
-}
-
-func (x *PodDisruptionBudgetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yys98Slc = z.DecScratchBuffer() // default slice to decode into
- _ = yys98Slc
- var yyhl98 bool = l >= 0
- for yyj98 := 0; ; yyj98++ {
- if yyhl98 {
- if yyj98 >= l {
- break
- }
- } else {
- if r.CheckBreak() {
- break
- }
- }
- z.DecSendContainerState(codecSelfer_containerMapKey1234)
- yys98Slc = r.DecodeBytes(yys98Slc, true, true)
- yys98 := string(yys98Slc)
- z.DecSendContainerState(codecSelfer_containerMapValue1234)
- switch yys98 {
- case "kind":
- if r.TryDecodeAsNil() {
- x.Kind = ""
- } else {
- x.Kind = string(r.DecodeString())
- }
- case "apiVersion":
- if r.TryDecodeAsNil() {
- x.APIVersion = ""
- } else {
- x.APIVersion = string(r.DecodeString())
- }
- case "metadata":
- if r.TryDecodeAsNil() {
- x.ListMeta = pkg2_unversioned.ListMeta{}
- } else {
- yyv101 := &x.ListMeta
- yym102 := z.DecBinary()
- _ = yym102
- if false {
- } else if z.HasExtensions() && z.DecExt(yyv101) {
- } else {
- z.DecFallback(yyv101, false)
- }
- }
- case "items":
- if r.TryDecodeAsNil() {
- x.Items = nil
- } else {
- yyv103 := &x.Items
- yym104 := z.DecBinary()
- _ = yym104
- if false {
- } else {
- h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv103), d)
- }
- }
- default:
- z.DecStructFieldNotFound(-1, yys98)
- } // end switch yys98
- } // end for yyj98
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
-}
-
-func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yyj105 int
- var yyb105 bool
- var yyhl105 bool = l >= 0
- yyj105++
- if yyhl105 {
- yyb105 = yyj105 > l
- } else {
- yyb105 = r.CheckBreak()
- }
- if yyb105 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.Kind = ""
- } else {
- x.Kind = string(r.DecodeString())
- }
- yyj105++
- if yyhl105 {
- yyb105 = yyj105 > l
- } else {
- yyb105 = r.CheckBreak()
- }
- if yyb105 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.APIVersion = ""
- } else {
- x.APIVersion = string(r.DecodeString())
- }
- yyj105++
- if yyhl105 {
- yyb105 = yyj105 > l
- } else {
- yyb105 = r.CheckBreak()
- }
- if yyb105 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.ListMeta = pkg2_unversioned.ListMeta{}
- } else {
- yyv108 := &x.ListMeta
- yym109 := z.DecBinary()
- _ = yym109
- if false {
- } else if z.HasExtensions() && z.DecExt(yyv108) {
- } else {
- z.DecFallback(yyv108, false)
- }
- }
- yyj105++
- if yyhl105 {
- yyb105 = yyj105 > l
- } else {
- yyb105 = r.CheckBreak()
- }
- if yyb105 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.Items = nil
- } else {
- yyv110 := &x.Items
- yym111 := z.DecBinary()
- _ = yym111
- if false {
- } else {
- h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv110), d)
- }
- }
- for {
- yyj105++
- if yyhl105 {
- yyb105 = yyj105 > l
- } else {
- yyb105 = r.CheckBreak()
- }
- if yyb105 {
- break
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj105-1, "")
- }
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
-}
-
-func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperEncoder(e)
- _, _, _ = h, z, r
- if x == nil {
- r.EncodeNil()
- } else {
- yym112 := z.EncBinary()
- _ = yym112
- if false {
- } else if z.HasExtensions() && z.EncExt(x) {
- } else {
- yysep113 := !z.EncBinary()
- yy2arr113 := z.EncBasicHandle().StructToArray
- var yyq113 [4]bool
- _, _, _ = yysep113, yyq113, yy2arr113
- const yyr113 bool = false
- yyq113[0] = x.Kind != ""
- yyq113[1] = x.APIVersion != ""
- yyq113[2] = true
- yyq113[3] = x.DeleteOptions != nil
- var yynn113 int
- if yyr113 || yy2arr113 {
- r.EncodeArrayStart(4)
- } else {
- yynn113 = 0
- for _, b := range yyq113 {
- if b {
- yynn113++
- }
- }
- r.EncodeMapStart(yynn113)
- yynn113 = 0
- }
- if yyr113 || yy2arr113 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq113[0] {
- yym115 := z.EncBinary()
- _ = yym115
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
- }
- } else {
- r.EncodeString(codecSelferC_UTF81234, "")
- }
- } else {
- if yyq113[0] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("kind"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym116 := z.EncBinary()
- _ = yym116
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
- }
- }
- }
- if yyr113 || yy2arr113 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq113[1] {
- yym118 := z.EncBinary()
- _ = yym118
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
- }
- } else {
- r.EncodeString(codecSelferC_UTF81234, "")
- }
- } else {
- if yyq113[1] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yym119 := z.EncBinary()
- _ = yym119
- if false {
- } else {
- r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
- }
- }
- }
- if yyr113 || yy2arr113 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq113[2] {
- yy121 := &x.ObjectMeta
- yy121.CodecEncodeSelf(e)
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq113[2] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("metadata"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- yy122 := &x.ObjectMeta
- yy122.CodecEncodeSelf(e)
- }
- }
- if yyr113 || yy2arr113 {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- if yyq113[3] {
- if x.DeleteOptions == nil {
- r.EncodeNil()
- } else {
- x.DeleteOptions.CodecEncodeSelf(e)
- }
- } else {
- r.EncodeNil()
- }
- } else {
- if yyq113[3] {
- z.EncSendContainerState(codecSelfer_containerMapKey1234)
- r.EncodeString(codecSelferC_UTF81234, string("deleteOptions"))
- z.EncSendContainerState(codecSelfer_containerMapValue1234)
- if x.DeleteOptions == nil {
- r.EncodeNil()
- } else {
- x.DeleteOptions.CodecEncodeSelf(e)
- }
- }
- }
- if yyr113 || yy2arr113 {
- z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- z.EncSendContainerState(codecSelfer_containerMapEnd1234)
- }
- }
- }
-}
-
-func (x *Eviction) CodecDecodeSelf(d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- yym124 := z.DecBinary()
- _ = yym124
- if false {
- } else if z.HasExtensions() && z.DecExt(x) {
- } else {
- yyct125 := r.ContainerType()
- if yyct125 == codecSelferValueTypeMap1234 {
- yyl125 := r.ReadMapStart()
- if yyl125 == 0 {
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
- } else {
- x.codecDecodeSelfFromMap(yyl125, d)
- }
- } else if yyct125 == codecSelferValueTypeArray1234 {
- yyl125 := r.ReadArrayStart()
- if yyl125 == 0 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- } else {
- x.codecDecodeSelfFromArray(yyl125, d)
- }
- } else {
- panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
- }
- }
-}
-
-func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yys126Slc = z.DecScratchBuffer() // default slice to decode into
- _ = yys126Slc
- var yyhl126 bool = l >= 0
- for yyj126 := 0; ; yyj126++ {
- if yyhl126 {
- if yyj126 >= l {
- break
- }
- } else {
- if r.CheckBreak() {
- break
- }
- }
- z.DecSendContainerState(codecSelfer_containerMapKey1234)
- yys126Slc = r.DecodeBytes(yys126Slc, true, true)
- yys126 := string(yys126Slc)
- z.DecSendContainerState(codecSelfer_containerMapValue1234)
- switch yys126 {
- case "kind":
- if r.TryDecodeAsNil() {
- x.Kind = ""
- } else {
- x.Kind = string(r.DecodeString())
- }
- case "apiVersion":
- if r.TryDecodeAsNil() {
- x.APIVersion = ""
- } else {
- x.APIVersion = string(r.DecodeString())
- }
- case "metadata":
- if r.TryDecodeAsNil() {
- x.ObjectMeta = pkg3_v1.ObjectMeta{}
- } else {
- yyv129 := &x.ObjectMeta
- yyv129.CodecDecodeSelf(d)
- }
- case "deleteOptions":
- if r.TryDecodeAsNil() {
- if x.DeleteOptions != nil {
- x.DeleteOptions = nil
- }
- } else {
- if x.DeleteOptions == nil {
- x.DeleteOptions = new(pkg3_v1.DeleteOptions)
- }
- x.DeleteOptions.CodecDecodeSelf(d)
- }
- default:
- z.DecStructFieldNotFound(-1, yys126)
- } // end switch yys126
- } // end for yyj126
- z.DecSendContainerState(codecSelfer_containerMapEnd1234)
-}
-
-func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
- var yyj131 int
- var yyb131 bool
- var yyhl131 bool = l >= 0
- yyj131++
- if yyhl131 {
- yyb131 = yyj131 > l
- } else {
- yyb131 = r.CheckBreak()
- }
- if yyb131 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.Kind = ""
- } else {
- x.Kind = string(r.DecodeString())
- }
- yyj131++
- if yyhl131 {
- yyb131 = yyj131 > l
- } else {
- yyb131 = r.CheckBreak()
- }
- if yyb131 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.APIVersion = ""
- } else {
- x.APIVersion = string(r.DecodeString())
- }
- yyj131++
- if yyhl131 {
- yyb131 = yyj131 > l
- } else {
- yyb131 = r.CheckBreak()
- }
- if yyb131 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- x.ObjectMeta = pkg3_v1.ObjectMeta{}
- } else {
- yyv134 := &x.ObjectMeta
- yyv134.CodecDecodeSelf(d)
- }
- yyj131++
- if yyhl131 {
- yyb131 = yyj131 > l
- } else {
- yyb131 = r.CheckBreak()
- }
- if yyb131 {
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
- return
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- if r.TryDecodeAsNil() {
- if x.DeleteOptions != nil {
- x.DeleteOptions = nil
- }
- } else {
- if x.DeleteOptions == nil {
- x.DeleteOptions = new(pkg3_v1.DeleteOptions)
- }
- x.DeleteOptions.CodecDecodeSelf(d)
- }
- for {
- yyj131++
- if yyhl131 {
- yyb131 = yyj131 > l
- } else {
- yyb131 = r.CheckBreak()
- }
- if yyb131 {
- break
- }
- z.DecSendContainerState(codecSelfer_containerArrayElem1234)
- z.DecStructFieldNotFound(yyj131-1, "")
- }
- z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
-}
-
-func (x codecSelfer1234) encSlicePodDisruptionBudget(v []PodDisruptionBudget, e *codec1978.Encoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperEncoder(e)
- _, _, _ = h, z, r
- r.EncodeArrayStart(len(v))
- for _, yyv136 := range v {
- z.EncSendContainerState(codecSelfer_containerArrayElem1234)
- yy137 := &yyv136
- yy137.CodecEncodeSelf(e)
- }
- z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
-}
-
-func (x codecSelfer1234) decSlicePodDisruptionBudget(v *[]PodDisruptionBudget, d *codec1978.Decoder) {
- var h codecSelfer1234
- z, r := codec1978.GenHelperDecoder(d)
- _, _, _ = h, z, r
-
- yyv138 := *v
- yyh138, yyl138 := z.DecSliceHelperStart()
- var yyc138 bool
- if yyl138 == 0 {
- if yyv138 == nil {
- yyv138 = []PodDisruptionBudget{}
- yyc138 = true
- } else if len(yyv138) != 0 {
- yyv138 = yyv138[:0]
- yyc138 = true
- }
- } else if yyl138 > 0 {
- var yyrr138, yyrl138 int
- var yyrt138 bool
- if yyl138 > cap(yyv138) {
-
- yyrg138 := len(yyv138) > 0
- yyv2138 := yyv138
- yyrl138, yyrt138 = z.DecInferLen(yyl138, z.DecBasicHandle().MaxInitLen, 312)
- if yyrt138 {
- if yyrl138 <= cap(yyv138) {
- yyv138 = yyv138[:yyrl138]
- } else {
- yyv138 = make([]PodDisruptionBudget, yyrl138)
- }
- } else {
- yyv138 = make([]PodDisruptionBudget, yyrl138)
- }
- yyc138 = true
- yyrr138 = len(yyv138)
- if yyrg138 {
- copy(yyv138, yyv2138)
- }
- } else if yyl138 != len(yyv138) {
- yyv138 = yyv138[:yyl138]
- yyc138 = true
- }
- yyj138 := 0
- for ; yyj138 < yyrr138; yyj138++ {
- yyh138.ElemContainerState(yyj138)
- if r.TryDecodeAsNil() {
- yyv138[yyj138] = PodDisruptionBudget{}
- } else {
- yyv139 := &yyv138[yyj138]
- yyv139.CodecDecodeSelf(d)
- }
-
- }
- if yyrt138 {
- for ; yyj138 < yyl138; yyj138++ {
- yyv138 = append(yyv138, PodDisruptionBudget{})
- yyh138.ElemContainerState(yyj138)
- if r.TryDecodeAsNil() {
- yyv138[yyj138] = PodDisruptionBudget{}
- } else {
- yyv140 := &yyv138[yyj138]
- yyv140.CodecDecodeSelf(d)
- }
-
- }
- }
-
- } else {
- yyj138 := 0
- for ; !r.CheckBreak(); yyj138++ {
-
- if yyj138 >= len(yyv138) {
- yyv138 = append(yyv138, PodDisruptionBudget{}) // var yyz138 PodDisruptionBudget
- yyc138 = true
- }
- yyh138.ElemContainerState(yyj138)
- if yyj138 < len(yyv138) {
- if r.TryDecodeAsNil() {
- yyv138[yyj138] = PodDisruptionBudget{}
- } else {
- yyv141 := &yyv138[yyj138]
- yyv141.CodecDecodeSelf(d)
- }
-
- } else {
- z.DecSwallow()
- }
-
- }
- if yyj138 < len(yyv138) {
- yyv138 = yyv138[:yyj138]
- yyc138 = true
- } else if yyj138 == 0 && yyv138 == nil {
- yyv138 = []PodDisruptionBudget{}
- yyc138 = true
- }
- }
- yyh138.End()
- if yyc138 {
- *v = yyv138
- }
-}
diff --git a/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go
deleted file mode 100644
index c5a4ee22a54..00000000000
--- a/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright 2016 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// This file was autogenerated by deepcopy-gen. Do not edit it manually!
-
-package v1alpha1
-
-import (
- unversioned "k8s.io/kubernetes/pkg/api/unversioned"
- v1 "k8s.io/kubernetes/pkg/api/v1"
- conversion "k8s.io/kubernetes/pkg/conversion"
- runtime "k8s.io/kubernetes/pkg/runtime"
- reflect "reflect"
-)
-
-func init() {
- SchemeBuilder.Register(RegisterDeepCopies)
-}
-
-// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
-// to allow building arbitrary schemes.
-func RegisterDeepCopies(scheme *runtime.Scheme) error {
- return scheme.AddGeneratedDeepCopyFuncs(
- conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_Eviction, InType: reflect.TypeOf(&Eviction{})},
- conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudget, InType: reflect.TypeOf(&PodDisruptionBudget{})},
- conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetList, InType: reflect.TypeOf(&PodDisruptionBudgetList{})},
- conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetSpec, InType: reflect.TypeOf(&PodDisruptionBudgetSpec{})},
- conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetStatus, InType: reflect.TypeOf(&PodDisruptionBudgetStatus{})},
- )
-}
-
-func DeepCopy_v1alpha1_Eviction(in interface{}, out interface{}, c *conversion.Cloner) error {
- {
- in := in.(*Eviction)
- out := out.(*Eviction)
- out.TypeMeta = in.TypeMeta
- if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
- return err
- }
- if in.DeleteOptions != nil {
- in, out := &in.DeleteOptions, &out.DeleteOptions
- *out = new(v1.DeleteOptions)
- if err := v1.DeepCopy_v1_DeleteOptions(*in, *out, c); err != nil {
- return err
- }
- } else {
- out.DeleteOptions = nil
- }
- return nil
- }
-}
-
-func DeepCopy_v1alpha1_PodDisruptionBudget(in interface{}, out interface{}, c *conversion.Cloner) error {
- {
- in := in.(*PodDisruptionBudget)
- out := out.(*PodDisruptionBudget)
- out.TypeMeta = in.TypeMeta
- if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
- return err
- }
- if err := DeepCopy_v1alpha1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, c); err != nil {
- return err
- }
- out.Status = in.Status
- return nil
- }
-}
-
-func DeepCopy_v1alpha1_PodDisruptionBudgetList(in interface{}, out interface{}, c *conversion.Cloner) error {
- {
- in := in.(*PodDisruptionBudgetList)
- out := out.(*PodDisruptionBudgetList)
- out.TypeMeta = in.TypeMeta
- out.ListMeta = in.ListMeta
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]PodDisruptionBudget, len(*in))
- for i := range *in {
- if err := DeepCopy_v1alpha1_PodDisruptionBudget(&(*in)[i], &(*out)[i], c); err != nil {
- return err
- }
- }
- } else {
- out.Items = nil
- }
- return nil
- }
-}
-
-func DeepCopy_v1alpha1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
- {
- in := in.(*PodDisruptionBudgetSpec)
- out := out.(*PodDisruptionBudgetSpec)
- out.MinAvailable = in.MinAvailable
- if in.Selector != nil {
- in, out := &in.Selector, &out.Selector
- *out = new(unversioned.LabelSelector)
- if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
- return err
- }
- } else {
- out.Selector = nil
- }
- return nil
- }
-}
-
-func DeepCopy_v1alpha1_PodDisruptionBudgetStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
- {
- in := in.(*PodDisruptionBudgetStatus)
- out := out.(*PodDisruptionBudgetStatus)
- out.PodDisruptionAllowed = in.PodDisruptionAllowed
- out.CurrentHealthy = in.CurrentHealthy
- out.DesiredHealthy = in.DesiredHealthy
- out.ExpectedPods = in.ExpectedPods
- return nil
- }
-}
From 28ba67d8f061748c8a35227860d840fcd5904c5d Mon Sep 17 00:00:00 2001
From: Marcin
Date: Wed, 26 Oct 2016 11:37:48 +0200
Subject: [PATCH 3/6] Disable generators for policy/v1alpha1
---
pkg/apis/policy/v1alpha1/doc.go | 5 -----
1 file changed, 5 deletions(-)
diff --git a/pkg/apis/policy/v1alpha1/doc.go b/pkg/apis/policy/v1alpha1/doc.go
index 510c600f323..5afe42a12b3 100644
--- a/pkg/apis/policy/v1alpha1/doc.go
+++ b/pkg/apis/policy/v1alpha1/doc.go
@@ -14,12 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// +k8s:deepcopy-gen=package,register
-// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/policy
-// +k8s:defaulter-gen=TypeMeta
-
// Package policy is for any kind of policy object. Suitable examples, even if
// they aren't all here, are PodDisruptionBudget, PodSecurityPolicy,
// NetworkPolicy, etc.
-// +k8s:openapi-gen=true
package v1alpha1 // import "k8s.io/kubernetes/pkg/apis/policy/v1alpha1"
From d413f6979bd7c94bfc68135bc3cfec515db4efb2 Mon Sep 17 00:00:00 2001
From: Marcin
Date: Wed, 26 Oct 2016 12:01:57 +0200
Subject: [PATCH 4/6] Temporairly remove disruption e2e
---
test/e2e/disruption.go | 290 -----------------------------------------
test/e2e/service.go | 3 +
2 files changed, 3 insertions(+), 290 deletions(-)
delete mode 100644 test/e2e/disruption.go
diff --git a/test/e2e/disruption.go b/test/e2e/disruption.go
deleted file mode 100644
index fe2953721b8..00000000000
--- a/test/e2e/disruption.go
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
-Copyright 2016 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package e2e
-
-import (
- "fmt"
- "time"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "k8s.io/client-go/kubernetes"
- "k8s.io/client-go/pkg/api/unversioned"
- api "k8s.io/client-go/pkg/api/v1"
- extensions "k8s.io/client-go/pkg/apis/extensions/v1beta1"
- policy "k8s.io/client-go/pkg/apis/policy/v1beta1"
- "k8s.io/client-go/pkg/util/intstr"
- "k8s.io/kubernetes/pkg/util/wait"
- "k8s.io/kubernetes/test/e2e/framework"
-)
-
-// timeout is used for most polling/waiting activities
-const timeout = 60 * time.Second
-
-// schedulingTimeout is longer specifically because sometimes we need to wait
-// awhile to guarantee that we've been patient waiting for something ordinary
-// to happen: a pod to get scheduled and move into Ready
-const schedulingTimeout = 10 * time.Minute
-
-var _ = framework.KubeDescribe("DisruptionController", func() {
- f := framework.NewDefaultFramework("disruption")
- var ns string
- var cs *kubernetes.Clientset
-
- BeforeEach(func() {
- // skip on GKE since alpha features are disabled
- framework.SkipIfProviderIs("gke")
-
- cs = f.StagingClient
- ns = f.Namespace.Name
- })
-
- It("should create a PodDisruptionBudget", func() {
- createPodDisruptionBudgetOrDie(cs, ns, intstr.FromString("1%"))
- })
-
- It("should update PodDisruptionBudget status", func() {
- createPodDisruptionBudgetOrDie(cs, ns, intstr.FromInt(2))
-
- createPodsOrDie(cs, ns, 3)
- waitForPodsOrDie(cs, ns, 3)
-
- // Since disruptionAllowed starts out false, if we see it ever become true,
- // that means the controller is working.
- err := wait.PollImmediate(framework.Poll, timeout, func() (bool, error) {
- pdb, err := cs.Policy().PodDisruptionBudgets(ns).Get("foo")
- if err != nil {
- return false, err
- }
- return pdb.Status.PodDisruptionAllowed, nil
- })
- Expect(err).NotTo(HaveOccurred())
-
- })
-
- evictionCases := []struct {
- description string
- minAvailable intstr.IntOrString
- podCount int
- replicaSetSize int32
- shouldDeny bool
- exclusive bool
- }{
- {
- description: "no PDB",
- minAvailable: intstr.FromString(""),
- podCount: 1,
- shouldDeny: false,
- }, {
- description: "too few pods, absolute",
- minAvailable: intstr.FromInt(2),
- podCount: 2,
- shouldDeny: true,
- }, {
- description: "enough pods, absolute",
- minAvailable: intstr.FromInt(2),
- podCount: 3,
- shouldDeny: false,
- }, {
- description: "enough pods, replicaSet, percentage",
- minAvailable: intstr.FromString("90%"),
- replicaSetSize: 10,
- exclusive: false,
- shouldDeny: false,
- }, {
- description: "too few pods, replicaSet, percentage",
- minAvailable: intstr.FromString("90%"),
- replicaSetSize: 10,
- exclusive: true,
- shouldDeny: true,
- },
- }
- for i := range evictionCases {
- c := evictionCases[i]
- expectation := "should allow an eviction"
- if c.shouldDeny {
- expectation = "should not allow an eviction"
- }
- It(fmt.Sprintf("evictions: %s => %s", c.description, expectation), func() {
- createPodsOrDie(cs, ns, c.podCount)
- if c.replicaSetSize > 0 {
- createReplicaSetOrDie(cs, ns, c.replicaSetSize, c.exclusive)
- }
-
- if c.minAvailable.String() != "" {
- createPodDisruptionBudgetOrDie(cs, ns, c.minAvailable)
- }
-
- // Locate a running pod.
- var pod api.Pod
- err := wait.PollImmediate(framework.Poll, schedulingTimeout, func() (bool, error) {
- podList, err := cs.Pods(ns).List(api.ListOptions{})
- if err != nil {
- return false, err
- }
-
- for i := range podList.Items {
- if podList.Items[i].Status.Phase == api.PodRunning {
- pod = podList.Items[i]
- return true, nil
- }
- }
-
- return false, nil
- })
- Expect(err).NotTo(HaveOccurred())
-
- e := &policy.Eviction{
- ObjectMeta: api.ObjectMeta{
- Name: pod.Name,
- Namespace: ns,
- },
- }
-
- if c.shouldDeny {
- // Since disruptionAllowed starts out false, wait at least 60s hoping that
- // this gives the controller enough time to have truly set the status.
- time.Sleep(timeout)
-
- err = cs.Pods(ns).Evict(e)
- Expect(err).Should(MatchError("Cannot evict pod as it would violate the pod's disruption budget."))
- } else {
- // Only wait for running pods in the "allow" case
- // because one of shouldDeny cases relies on the
- // replicaSet not fitting on the cluster.
- waitForPodsOrDie(cs, ns, c.podCount+int(c.replicaSetSize))
-
- // Since disruptionAllowed starts out false, if an eviction is ever allowed,
- // that means the controller is working.
- err = wait.PollImmediate(framework.Poll, timeout, func() (bool, error) {
- err = cs.Pods(ns).Evict(e)
- if err != nil {
- return false, nil
- } else {
- return true, nil
- }
- })
- Expect(err).NotTo(HaveOccurred())
- }
- })
- }
-
-})
-
-func createPodDisruptionBudgetOrDie(cs *kubernetes.Clientset, ns string, minAvailable intstr.IntOrString) {
- pdb := policy.PodDisruptionBudget{
- ObjectMeta: api.ObjectMeta{
- Name: "foo",
- Namespace: ns,
- },
- Spec: policy.PodDisruptionBudgetSpec{
- Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
- MinAvailable: minAvailable,
- },
- }
- _, err := cs.Policy().PodDisruptionBudgets(ns).Create(&pdb)
- Expect(err).NotTo(HaveOccurred())
-}
-
-func createPodsOrDie(cs *kubernetes.Clientset, ns string, n int) {
- for i := 0; i < n; i++ {
- pod := &api.Pod{
- ObjectMeta: api.ObjectMeta{
- Name: fmt.Sprintf("pod-%d", i),
- Namespace: ns,
- Labels: map[string]string{"foo": "bar"},
- },
- Spec: api.PodSpec{
- Containers: []api.Container{
- {
- Name: "busybox",
- Image: "gcr.io/google_containers/echoserver:1.4",
- },
- },
- RestartPolicy: api.RestartPolicyAlways,
- },
- }
-
- _, err := cs.Pods(ns).Create(pod)
- framework.ExpectNoError(err, "Creating pod %q in namespace %q", pod.Name, ns)
- }
-}
-
-func waitForPodsOrDie(cs *kubernetes.Clientset, ns string, n int) {
- By("Waiting for all pods to be running")
- err := wait.PollImmediate(framework.Poll, schedulingTimeout, func() (bool, error) {
- pods, err := cs.Core().Pods(ns).List(api.ListOptions{LabelSelector: "foo=bar"})
- if err != nil {
- return false, err
- }
- if pods == nil {
- return false, fmt.Errorf("pods is nil")
- }
- if len(pods.Items) < n {
- framework.Logf("pods: %v < %v", len(pods.Items), n)
- return false, nil
- }
- ready := 0
- for i := 0; i < n; i++ {
- if pods.Items[i].Status.Phase == api.PodRunning {
- ready++
- }
- }
- if ready < n {
- framework.Logf("running pods: %v < %v", ready, n)
- return false, nil
- }
- return true, nil
- })
- framework.ExpectNoError(err, "Waiting for pods in namespace %q to be ready", ns)
-}
-
-func createReplicaSetOrDie(cs *kubernetes.Clientset, ns string, size int32, exclusive bool) {
- container := api.Container{
- Name: "busybox",
- Image: "gcr.io/google_containers/echoserver:1.4",
- }
- if exclusive {
- container.Ports = []api.ContainerPort{
- {HostPort: 5555, ContainerPort: 5555},
- }
- }
-
- rs := &extensions.ReplicaSet{
- ObjectMeta: api.ObjectMeta{
- Name: "rs",
- Namespace: ns,
- },
- Spec: extensions.ReplicaSetSpec{
- Replicas: &size,
- Selector: &unversioned.LabelSelector{
- MatchLabels: map[string]string{"foo": "bar"},
- },
- Template: api.PodTemplateSpec{
- ObjectMeta: api.ObjectMeta{
- Labels: map[string]string{"foo": "bar"},
- },
- Spec: api.PodSpec{
- Containers: []api.Container{container},
- },
- },
- },
- }
-
- _, err := cs.Extensions().ReplicaSets(ns).Create(rs)
- framework.ExpectNoError(err, "Creating replica set %q in namespace %q", rs.Name, ns)
-}
diff --git a/test/e2e/service.go b/test/e2e/service.go
index 0be0a0f0731..6c2514e1602 100644
--- a/test/e2e/service.go
+++ b/test/e2e/service.go
@@ -71,6 +71,9 @@ const (
// Many tests create an endpoint per node, in large clusters, this is
// resource and time intensive.
maxNodesForEndpointsTests = 3
+
+ // timeout is used for most polling/waiting activities
+ timeout = 60 * time.Second
)
// This should match whatever the default/configured range is
From 3872a4707418ef9ac17cb64bd66dc0e25423f774 Mon Sep 17 00:00:00 2001
From: Marcin
Date: Wed, 26 Oct 2016 10:40:41 +0200
Subject: [PATCH 5/6] Autogenerated code and docs
---
api/openapi-spec/swagger.json | 297 +-
api/swagger-spec/policy_v1beta1.json | 1452 ++++++++++
api/swagger-spec/resourceListing.json | 4 +-
api/swagger-spec/v1.json | 12 +-
.../policy/v1alpha1/definitions.html | 2 +-
.../policy/v1alpha1/operations.html | 4 +
.../policy/v1beta1/definitions.html | 1395 ++++++++++
.../policy/v1beta1/operations.html | 2402 +++++++++++++++++
docs/api-reference/v1/definitions.html | 112 +-
docs/api-reference/v1/operations.html | 6 +-
hack/.linted_packages | 1 +
pkg/api/testing/BUILD | 1 +
pkg/apis/policy/install/BUILD | 2 +-
pkg/apis/policy/types.generated.go | 16 +-
pkg/apis/policy/v1alpha1/BUILD | 6 -
.../v1alpha1/zz_generated.conversion.go | 178 --
pkg/apis/policy/v1beta1/BUILD | 39 +
pkg/apis/policy/v1beta1/doc.go | 24 +
pkg/apis/policy/v1beta1/generated.pb.go | 1185 ++++++++
.../{v1alpha1 => v1beta1}/generated.proto | 18 +-
pkg/apis/policy/v1beta1/types.generated.go | 1752 ++++++++++++
pkg/apis/policy/v1beta1/types.go | 85 +
.../types_swagger_doc_generated.go | 14 +-
.../policy/v1beta1/zz_generated.conversion.go | 178 ++
.../policy/v1beta1/zz_generated.deepcopy.go | 133 +
pkg/apis/policy/validation/BUILD | 1 +
pkg/apis/policy/zz_generated.deepcopy.go | 2 +-
.../clientset_generated/release_1_5/BUILD | 2 +-
.../release_1_5/clientset.go | 24 +-
.../clientset_generated/release_1_5/doc.go | 2 +-
.../release_1_5/fake/BUILD | 4 +-
.../release_1_5/fake/clientset_generated.go | 16 +-
.../release_1_5/fake/doc.go | 2 +-
.../release_1_5/typed/apps/v1beta1/doc.go | 2 +-
.../typed/apps/v1beta1/fake/doc.go | 2 +-
.../typed/authentication/v1beta1/doc.go | 2 +-
.../typed/authentication/v1beta1/fake/doc.go | 2 +-
.../typed/authorization/v1beta1/doc.go | 2 +-
.../typed/authorization/v1beta1/fake/doc.go | 2 +-
.../release_1_5/typed/autoscaling/v1/doc.go | 2 +-
.../typed/autoscaling/v1/fake/doc.go | 2 +-
.../release_1_5/typed/batch/v1/doc.go | 2 +-
.../release_1_5/typed/batch/v1/fake/doc.go | 2 +-
.../release_1_5/typed/batch/v2alpha1/doc.go | 2 +-
.../typed/batch/v2alpha1/fake/doc.go | 2 +-
.../typed/certificates/v1alpha1/doc.go | 2 +-
.../typed/certificates/v1alpha1/fake/doc.go | 2 +-
.../release_1_5/typed/core/v1/doc.go | 2 +-
.../release_1_5/typed/core/v1/fake/doc.go | 2 +-
.../typed/extensions/v1beta1/doc.go | 2 +-
.../typed/extensions/v1beta1/fake/doc.go | 2 +-
.../release_1_5/typed/policy/v1beta1/BUILD | 32 +
.../release_1_5/typed/policy/v1beta1/doc.go | 20 +
.../typed/policy/v1beta1/fake/BUILD | 32 +
.../typed/policy/v1beta1/fake/doc.go | 20 +
.../v1beta1/fake/fake_poddisruptionbudget.go | 128 +
.../policy/v1beta1/fake/fake_policy_client.go | 38 +
.../policy/v1beta1/generated_expansion.go | 19 +
.../policy/v1beta1/poddisruptionbudget.go | 167 ++
.../typed/policy/v1beta1/policy_client.go | 98 +
.../release_1_5/typed/rbac/v1alpha1/doc.go | 2 +-
.../typed/rbac/v1alpha1/fake/doc.go | 2 +-
.../release_1_5/typed/storage/v1beta1/doc.go | 2 +-
.../typed/storage/v1beta1/fake/doc.go | 2 +-
.../zz_generated.statefulset.go | 2 +-
.../apps/v1beta1/zz_generated.statefulset.go | 2 +-
.../zz_generated.tokenreview.go | 2 +-
.../v1beta1/zz_generated.tokenreview.go | 2 +-
.../zz_generated.localsubjectaccessreview.go | 2 +-
.../zz_generated.selfsubjectaccessreview.go | 2 +-
.../zz_generated.subjectaccessreview.go | 2 +-
.../zz_generated.localsubjectaccessreview.go | 2 +-
.../zz_generated.selfsubjectaccessreview.go | 2 +-
.../zz_generated.subjectaccessreview.go | 2 +-
.../zz_generated.horizontalpodautoscaler.go | 2 +-
.../zz_generated.horizontalpodautoscaler.go | 2 +-
.../batch/internalversion/zz_generated.job.go | 2 +-
.../zz_generated.scheduledjob.go | 2 +-
.../listers/batch/v1/zz_generated.job.go | 2 +-
.../batch/v2alpha1/zz_generated.job.go | 2 +-
.../v2alpha1/zz_generated.scheduledjob.go | 2 +-
.../zz_generated.certificatesigningrequest.go | 2 +-
.../zz_generated.certificatesigningrequest.go | 2 +-
.../zz_generated.componentstatus.go | 2 +-
.../internalversion/zz_generated.configmap.go | 2 +-
.../internalversion/zz_generated.endpoints.go | 2 +-
.../internalversion/zz_generated.event.go | 2 +-
.../zz_generated.limitrange.go | 2 +-
.../internalversion/zz_generated.namespace.go | 2 +-
.../core/internalversion/zz_generated.node.go | 2 +-
.../zz_generated.persistentvolume.go | 2 +-
.../zz_generated.persistentvolumeclaim.go | 2 +-
.../core/internalversion/zz_generated.pod.go | 2 +-
.../zz_generated.podtemplate.go | 2 +-
.../zz_generated.replicationcontroller.go | 2 +-
.../zz_generated.resourcequota.go | 2 +-
.../internalversion/zz_generated.secret.go | 2 +-
.../internalversion/zz_generated.service.go | 2 +-
.../zz_generated.serviceaccount.go | 2 +-
.../core/v1/zz_generated.componentstatus.go | 2 +-
.../listers/core/v1/zz_generated.configmap.go | 2 +-
.../listers/core/v1/zz_generated.endpoints.go | 2 +-
.../listers/core/v1/zz_generated.event.go | 2 +-
.../core/v1/zz_generated.limitrange.go | 2 +-
.../listers/core/v1/zz_generated.namespace.go | 2 +-
.../listers/core/v1/zz_generated.node.go | 2 +-
.../core/v1/zz_generated.persistentvolume.go | 2 +-
.../v1/zz_generated.persistentvolumeclaim.go | 2 +-
.../listers/core/v1/zz_generated.pod.go | 2 +-
.../core/v1/zz_generated.podtemplate.go | 2 +-
.../v1/zz_generated.replicationcontroller.go | 2 +-
.../core/v1/zz_generated.resourcequota.go | 2 +-
.../listers/core/v1/zz_generated.secret.go | 2 +-
.../listers/core/v1/zz_generated.service.go | 2 +-
.../core/v1/zz_generated.serviceaccount.go | 2 +-
.../internalversion/zz_generated.daemonset.go | 2 +-
.../zz_generated.deployment.go | 2 +-
.../internalversion/zz_generated.ingress.go | 2 +-
.../zz_generated.networkpolicy.go | 2 +-
.../zz_generated.podsecuritypolicy.go | 2 +-
.../zz_generated.replicaset.go | 2 +-
.../internalversion/zz_generated.scale.go | 2 +-
.../zz_generated.thirdpartyresource.go | 2 +-
.../v1beta1/zz_generated.daemonset.go | 2 +-
.../v1beta1/zz_generated.deployment.go | 2 +-
.../v1beta1/zz_generated.ingress.go | 2 +-
.../extensions/v1beta1/zz_generated.job.go | 2 +-
.../v1beta1/zz_generated.podsecuritypolicy.go | 2 +-
.../v1beta1/zz_generated.replicaset.go | 2 +-
.../extensions/v1beta1/zz_generated.scale.go | 2 +-
.../zz_generated.thirdpartyresource.go | 2 +-
.../zz_generated.imagereview.go | 2 +-
.../v1alpha1/zz_generated.imagereview.go | 2 +-
.../zz_generated.poddisruptionbudget.go | 2 +-
.../zz_generated.poddisruptionbudget.go | 2 +-
pkg/client/listers/policy/v1beta1/BUILD | 24 +
.../zz_generated.poddisruptionbudget.go | 93 +
.../zz_generated.clusterrole.go | 2 +-
.../zz_generated.clusterrolebinding.go | 2 +-
.../rbac/internalversion/zz_generated.role.go | 2 +-
.../zz_generated.rolebinding.go | 2 +-
.../rbac/v1alpha1/zz_generated.clusterrole.go | 2 +-
.../zz_generated.clusterrolebinding.go | 2 +-
.../rbac/v1alpha1/zz_generated.role.go | 2 +-
.../rbac/v1alpha1/zz_generated.rolebinding.go | 2 +-
.../zz_generated.storageclass.go | 2 +-
.../v1beta1/zz_generated.storageclass.go | 2 +-
pkg/generated/openapi/zz_generated.openapi.go | 297 +-
pkg/master/BUILD | 2 +-
pkg/registry/policy/rest/BUILD | 2 +-
test/e2e/BUILD | 6 -
test/test_owners.csv | 3 -
152 files changed, 9849 insertions(+), 709 deletions(-)
create mode 100644 api/swagger-spec/policy_v1beta1.json
create mode 100755 docs/api-reference/policy/v1beta1/definitions.html
create mode 100755 docs/api-reference/policy/v1beta1/operations.html
delete mode 100644 pkg/apis/policy/v1alpha1/zz_generated.conversion.go
create mode 100644 pkg/apis/policy/v1beta1/BUILD
create mode 100644 pkg/apis/policy/v1beta1/doc.go
create mode 100644 pkg/apis/policy/v1beta1/generated.pb.go
rename pkg/apis/policy/{v1alpha1 => v1beta1}/generated.proto (89%)
create mode 100644 pkg/apis/policy/v1beta1/types.generated.go
create mode 100644 pkg/apis/policy/v1beta1/types.go
rename pkg/apis/policy/{v1alpha1 => v1beta1}/types_swagger_doc_generated.go (85%)
create mode 100644 pkg/apis/policy/v1beta1/zz_generated.conversion.go
create mode 100644 pkg/apis/policy/v1beta1/zz_generated.deepcopy.go
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/BUILD
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/doc.go
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/fake/BUILD
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/fake/doc.go
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/fake/fake_policy_client.go
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/generated_expansion.go
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/poddisruptionbudget.go
create mode 100644 pkg/client/clientset_generated/release_1_5/typed/policy/v1beta1/policy_client.go
create mode 100644 pkg/client/listers/policy/v1beta1/BUILD
create mode 100644 pkg/client/listers/policy/v1beta1/zz_generated.poddisruptionbudget.go
diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json
index 866942b0e84..bec5b7ace17 100644
--- a/api/openapi-spec/swagger.json
+++ b/api/openapi-spec/swagger.json
@@ -3373,7 +3373,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.Eviction"
+ "$ref": "#/definitions/v1beta1.Eviction"
}
},
"401": {
@@ -3387,7 +3387,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/v1alpha1.Eviction"
+ "$ref": "#/definitions/v1beta1.Eviction"
}
},
{
@@ -25158,7 +25158,7 @@
}
}
},
- "/apis/policy/v1alpha1/": {
+ "/apis/policy/v1beta1/": {
"get": {
"description": "get available resources",
"consumes": [
@@ -25175,9 +25175,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "getPolicyV1alpha1APIResources",
+ "operationId": "getPolicyV1beta1APIResources",
"responses": {
"200": {
"description": "OK",
@@ -25191,7 +25191,7 @@
}
}
},
- "/apis/policy/v1alpha1/namespaces/{namespace}/poddisruptionbudgets": {
+ "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets": {
"get": {
"description": "list or watch objects of kind PodDisruptionBudget",
"consumes": [
@@ -25208,9 +25208,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "listPolicyV1alpha1NamespacedPodDisruptionBudget",
+ "operationId": "listPolicyV1beta1NamespacedPodDisruptionBudget",
"parameters": [
{
"uniqueItems": true,
@@ -25252,7 +25252,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudgetList"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudgetList"
}
},
"401": {
@@ -25274,16 +25274,16 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "createPolicyV1alpha1NamespacedPodDisruptionBudget",
+ "operationId": "createPolicyV1beta1NamespacedPodDisruptionBudget",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
}
],
@@ -25291,7 +25291,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
},
"401": {
@@ -25313,9 +25313,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "deletePolicyV1alpha1CollectionNamespacedPodDisruptionBudget",
+ "operationId": "deletePolicyV1beta1CollectionNamespacedPodDisruptionBudget",
"parameters": [
{
"uniqueItems": true,
@@ -25383,7 +25383,7 @@
}
]
},
- "/apis/policy/v1alpha1/namespaces/{namespace}/poddisruptionbudgets/{name}": {
+ "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}": {
"get": {
"description": "read the specified PodDisruptionBudget",
"consumes": [
@@ -25398,9 +25398,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "readPolicyV1alpha1NamespacedPodDisruptionBudget",
+ "operationId": "readPolicyV1beta1NamespacedPodDisruptionBudget",
"parameters": [
{
"uniqueItems": true,
@@ -25421,7 +25421,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
},
"401": {
@@ -25443,16 +25443,16 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "replacePolicyV1alpha1NamespacedPodDisruptionBudget",
+ "operationId": "replacePolicyV1beta1NamespacedPodDisruptionBudget",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
}
],
@@ -25460,7 +25460,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
},
"401": {
@@ -25482,9 +25482,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "deletePolicyV1alpha1NamespacedPodDisruptionBudget",
+ "operationId": "deletePolicyV1beta1NamespacedPodDisruptionBudget",
"parameters": [
{
"name": "body",
@@ -25523,9 +25523,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "patchPolicyV1alpha1NamespacedPodDisruptionBudget",
+ "operationId": "patchPolicyV1beta1NamespacedPodDisruptionBudget",
"parameters": [
{
"name": "body",
@@ -25540,7 +25540,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
},
"401": {
@@ -25574,7 +25574,7 @@
}
]
},
- "/apis/policy/v1alpha1/namespaces/{namespace}/poddisruptionbudgets/{name}/status": {
+ "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status": {
"get": {
"description": "read status of the specified PodDisruptionBudget",
"consumes": [
@@ -25589,14 +25589,14 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "readPolicyV1alpha1NamespacedPodDisruptionBudgetStatus",
+ "operationId": "readPolicyV1beta1NamespacedPodDisruptionBudgetStatus",
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
},
"401": {
@@ -25618,16 +25618,16 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "replacePolicyV1alpha1NamespacedPodDisruptionBudgetStatus",
+ "operationId": "replacePolicyV1beta1NamespacedPodDisruptionBudgetStatus",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
}
],
@@ -25635,7 +25635,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
},
"401": {
@@ -25659,9 +25659,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "patchPolicyV1alpha1NamespacedPodDisruptionBudgetStatus",
+ "operationId": "patchPolicyV1beta1NamespacedPodDisruptionBudgetStatus",
"parameters": [
{
"name": "body",
@@ -25676,7 +25676,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
}
},
"401": {
@@ -25710,7 +25710,7 @@
}
]
},
- "/apis/policy/v1alpha1/poddisruptionbudgets": {
+ "/apis/policy/v1beta1/poddisruptionbudgets": {
"get": {
"description": "list or watch objects of kind PodDisruptionBudget",
"consumes": [
@@ -25727,14 +25727,14 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "listPolicyV1alpha1PodDisruptionBudgetForAllNamespaces",
+ "operationId": "listPolicyV1beta1PodDisruptionBudgetForAllNamespaces",
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudgetList"
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudgetList"
}
},
"401": {
@@ -25787,7 +25787,7 @@
}
]
},
- "/apis/policy/v1alpha1/watch/namespaces/{namespace}/poddisruptionbudgets": {
+ "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets": {
"get": {
"description": "watch individual changes to a list of PodDisruptionBudget",
"consumes": [
@@ -25804,9 +25804,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "watchPolicyV1alpha1NamespacedPodDisruptionBudgetList",
+ "operationId": "watchPolicyV1beta1NamespacedPodDisruptionBudgetList",
"responses": {
"200": {
"description": "OK",
@@ -25872,7 +25872,7 @@
}
]
},
- "/apis/policy/v1alpha1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}": {
+ "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}": {
"get": {
"description": "watch changes to an object of kind PodDisruptionBudget",
"consumes": [
@@ -25889,9 +25889,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "watchPolicyV1alpha1NamespacedPodDisruptionBudget",
+ "operationId": "watchPolicyV1beta1NamespacedPodDisruptionBudget",
"responses": {
"200": {
"description": "OK",
@@ -25965,7 +25965,7 @@
}
]
},
- "/apis/policy/v1alpha1/watch/poddisruptionbudgets": {
+ "/apis/policy/v1beta1/watch/poddisruptionbudgets": {
"get": {
"description": "watch individual changes to a list of PodDisruptionBudget",
"consumes": [
@@ -25982,9 +25982,9 @@
"https"
],
"tags": [
- "policy_v1alpha1"
+ "policy_v1beta1"
],
- "operationId": "watchPolicyV1alpha1PodDisruptionBudgetListForAllNamespaces",
+ "operationId": "watchPolicyV1beta1PodDisruptionBudgetListForAllNamespaces",
"responses": {
"200": {
"description": "OK",
@@ -32405,95 +32405,6 @@
}
}
},
- "v1alpha1.Eviction": {
- "description": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/\u003cpod name\u003e/eviction.",
- "properties": {
- "deleteOptions": {
- "description": "DeleteOptions may be provided",
- "$ref": "#/definitions/v1.DeleteOptions"
- },
- "metadata": {
- "description": "ObjectMeta describes the pod that is being evicted.",
- "$ref": "#/definitions/v1.ObjectMeta"
- }
- }
- },
- "v1alpha1.PodDisruptionBudget": {
- "description": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods",
- "properties": {
- "metadata": {
- "$ref": "#/definitions/v1.ObjectMeta"
- },
- "spec": {
- "description": "Specification of the desired behavior of the PodDisruptionBudget.",
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudgetSpec"
- },
- "status": {
- "description": "Most recently observed status of the PodDisruptionBudget.",
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudgetStatus"
- }
- }
- },
- "v1alpha1.PodDisruptionBudgetList": {
- "description": "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.",
- "required": [
- "items"
- ],
- "properties": {
- "items": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/v1alpha1.PodDisruptionBudget"
- }
- },
- "metadata": {
- "$ref": "#/definitions/unversioned.ListMeta"
- }
- }
- },
- "v1alpha1.PodDisruptionBudgetSpec": {
- "description": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
- "properties": {
- "minAvailable": {
- "description": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".",
- "$ref": "#/definitions/intstr.IntOrString"
- },
- "selector": {
- "description": "Label query over pods whose evictions are managed by the disruption budget.",
- "$ref": "#/definitions/unversioned.LabelSelector"
- }
- }
- },
- "v1alpha1.PodDisruptionBudgetStatus": {
- "description": "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.",
- "required": [
- "disruptionAllowed",
- "currentHealthy",
- "desiredHealthy",
- "expectedPods"
- ],
- "properties": {
- "currentHealthy": {
- "description": "current number of healthy pods",
- "type": "integer",
- "format": "int32"
- },
- "desiredHealthy": {
- "description": "minimum desired number of healthy pods",
- "type": "integer",
- "format": "int32"
- },
- "disruptionAllowed": {
- "description": "Whether or not a disruption is currently allowed.",
- "type": "boolean"
- },
- "expectedPods": {
- "description": "total number of pods counted by this disruption budget",
- "type": "integer",
- "format": "int32"
- }
- }
- },
"v1alpha1.PolicyRule": {
"description": "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.",
"required": [
@@ -32972,6 +32883,23 @@
}
}
},
+ "v1beta1.Eviction": {
+ "description": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/\u003cpod name\u003e/evictions.",
+ "required": [
+ "metadata",
+ "deleteOptions"
+ ],
+ "properties": {
+ "deleteOptions": {
+ "description": "DeleteOptions may be provided",
+ "$ref": "#/definitions/v1.DeleteOptions"
+ },
+ "metadata": {
+ "description": "ObjectMeta describes the pod that is being evicted.",
+ "$ref": "#/definitions/v1.ObjectMeta"
+ }
+ }
+ },
"v1beta1.HorizontalPodAutoscaler": {
"description": "configuration of a horizontal pod autoscaler.",
"properties": {
@@ -33441,6 +33369,93 @@
}
}
},
+ "v1beta1.PodDisruptionBudget": {
+ "description": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods",
+ "required": [
+ "metadata",
+ "spec",
+ "status"
+ ],
+ "properties": {
+ "metadata": {
+ "$ref": "#/definitions/v1.ObjectMeta"
+ },
+ "spec": {
+ "description": "Specification of the desired behavior of the PodDisruptionBudget.",
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudgetSpec"
+ },
+ "status": {
+ "description": "Most recently observed status of the PodDisruptionBudget.",
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudgetStatus"
+ }
+ }
+ },
+ "v1beta1.PodDisruptionBudgetList": {
+ "description": "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.",
+ "required": [
+ "metadata",
+ "items"
+ ],
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1beta1.PodDisruptionBudget"
+ }
+ },
+ "metadata": {
+ "$ref": "#/definitions/unversioned.ListMeta"
+ }
+ }
+ },
+ "v1beta1.PodDisruptionBudgetSpec": {
+ "description": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
+ "required": [
+ "minAvailable",
+ "selector"
+ ],
+ "properties": {
+ "minAvailable": {
+ "description": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".",
+ "$ref": "#/definitions/intstr.IntOrString"
+ },
+ "selector": {
+ "description": "Label query over pods whose evictions are managed by the disruption budget.",
+ "$ref": "#/definitions/unversioned.LabelSelector"
+ }
+ }
+ },
+ "v1beta1.PodDisruptionBudgetStatus": {
+ "description": "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.",
+ "required": [
+ "disruptionsAllowed",
+ "currentHealthy",
+ "desiredHealthy",
+ "expectedPods"
+ ],
+ "properties": {
+ "currentHealthy": {
+ "description": "current number of healthy pods",
+ "type": "integer",
+ "format": "int32"
+ },
+ "desiredHealthy": {
+ "description": "minimum desired number of healthy pods",
+ "type": "integer",
+ "format": "int32"
+ },
+ "disruptionsAllowed": {
+ "description": "Number of pod disruptions that are currently allowed.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "expectedPods": {
+ "description": "total number of pods counted by this disruption budget",
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ },
"v1beta1.ReplicaSet": {
"description": "ReplicaSet represents the configuration of a ReplicaSet.",
"properties": {
diff --git a/api/swagger-spec/policy_v1beta1.json b/api/swagger-spec/policy_v1beta1.json
new file mode 100644
index 00000000000..27da5500f9d
--- /dev/null
+++ b/api/swagger-spec/policy_v1beta1.json
@@ -0,0 +1,1452 @@
+{
+ "swaggerVersion": "1.2",
+ "apiVersion": "policy/v1beta1",
+ "basePath": "https://10.10.10.10:6443",
+ "resourcePath": "/apis/policy/v1beta1",
+ "info": {
+ "title": "",
+ "description": ""
+ },
+ "apis": [
+ {
+ "path": "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "v1beta1.PodDisruptionBudgetList",
+ "method": "GET",
+ "summary": "list or watch objects of kind PodDisruptionBudget",
+ "nickname": "listNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudgetList"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "method": "POST",
+ "summary": "create a PodDisruptionBudget",
+ "nickname": "createNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudget"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "unversioned.Status",
+ "method": "DELETE",
+ "summary": "delete collection of PodDisruptionBudget",
+ "nickname": "deletecollectionNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "unversioned.Status"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "versioned.Event",
+ "method": "GET",
+ "summary": "watch individual changes to a list of PodDisruptionBudget",
+ "nickname": "watchNamespacedPodDisruptionBudgetList",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "versioned.Event"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "method": "GET",
+ "summary": "read the specified PodDisruptionBudget",
+ "nickname": "readNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "export",
+ "description": "Should this value be exported. Export strips fields that a user can not specify.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "exact",
+ "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudget"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "method": "PUT",
+ "summary": "replace the specified PodDisruptionBudget",
+ "nickname": "replaceNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudget"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "method": "PATCH",
+ "summary": "partially update the specified PodDisruptionBudget",
+ "nickname": "patchNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "unversioned.Patch",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudget"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ]
+ },
+ {
+ "type": "unversioned.Status",
+ "method": "DELETE",
+ "summary": "delete a PodDisruptionBudget",
+ "nickname": "deleteNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.DeleteOptions",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "unversioned.Status"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "versioned.Event",
+ "method": "GET",
+ "summary": "watch changes to an object of kind PodDisruptionBudget",
+ "nickname": "watchNamespacedPodDisruptionBudget",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "versioned.Event"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/policy/v1beta1/poddisruptionbudgets",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "v1beta1.PodDisruptionBudgetList",
+ "method": "GET",
+ "summary": "list or watch objects of kind PodDisruptionBudget",
+ "nickname": "listPodDisruptionBudgetForAllNamespaces",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call.",
+ "required": false,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudgetList"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/policy/v1beta1/watch/poddisruptionbudgets",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "versioned.Event",
+ "method": "GET",
+ "summary": "watch individual changes to a list of PodDisruptionBudget",
+ "nickname": "watchPodDisruptionBudgetListForAllNamespaces",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call.",
+ "required": false,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "versioned.Event"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "method": "GET",
+ "summary": "read status of the specified PodDisruptionBudget",
+ "nickname": "readNamespacedPodDisruptionBudgetStatus",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudget"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "method": "PUT",
+ "summary": "replace status of the specified PodDisruptionBudget",
+ "nickname": "replaceNamespacedPodDisruptionBudgetStatus",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudget"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta1.PodDisruptionBudget",
+ "method": "PATCH",
+ "summary": "partially update status of the specified PodDisruptionBudget",
+ "nickname": "patchNamespacedPodDisruptionBudgetStatus",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "unversioned.Patch",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the PodDisruptionBudget",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.PodDisruptionBudget"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/policy/v1beta1",
+ "description": "API at /apis/policy/v1beta1",
+ "operations": [
+ {
+ "type": "unversioned.APIResourceList",
+ "method": "GET",
+ "summary": "get available resources",
+ "nickname": "getAPIResources",
+ "parameters": [],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ]
+ }
+ ]
+ }
+ ],
+ "models": {
+ "v1beta1.PodDisruptionBudgetList": {
+ "id": "v1beta1.PodDisruptionBudgetList",
+ "description": "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.",
+ "required": [
+ "items"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "unversioned.ListMeta"
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "v1beta1.PodDisruptionBudget"
+ }
+ }
+ }
+ },
+ "unversioned.ListMeta": {
+ "id": "unversioned.ListMeta",
+ "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.",
+ "properties": {
+ "selfLink": {
+ "type": "string",
+ "description": "SelfLink is a URL representing this object. Populated by the system. Read-only."
+ },
+ "resourceVersion": {
+ "type": "string",
+ "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency"
+ }
+ }
+ },
+ "v1beta1.PodDisruptionBudget": {
+ "id": "v1beta1.PodDisruptionBudget",
+ "description": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "v1.ObjectMeta"
+ },
+ "spec": {
+ "$ref": "v1beta1.PodDisruptionBudgetSpec",
+ "description": "Specification of the desired behavior of the PodDisruptionBudget."
+ },
+ "status": {
+ "$ref": "v1beta1.PodDisruptionBudgetStatus",
+ "description": "Most recently observed status of the PodDisruptionBudget."
+ }
+ }
+ },
+ "v1.ObjectMeta": {
+ "id": "v1.ObjectMeta",
+ "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
+ },
+ "generateName": {
+ "type": "string",
+ "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency"
+ },
+ "namespace": {
+ "type": "string",
+ "description": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "SelfLink is a URL representing this object. Populated by the system. Read-only."
+ },
+ "uid": {
+ "type": "string",
+ "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
+ },
+ "resourceVersion": {
+ "type": "string",
+ "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency"
+ },
+ "generation": {
+ "type": "integer",
+ "format": "int64",
+ "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only."
+ },
+ "creationTimestamp": {
+ "type": "string",
+ "format": "date-time",
+ "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata"
+ },
+ "deletionTimestamp": {
+ "type": "string",
+ "format": "date-time",
+ "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource will be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet will send a hard termination signal to the container. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata"
+ },
+ "deletionGracePeriodSeconds": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only."
+ },
+ "labels": {
+ "type": "object",
+ "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels"
+ },
+ "annotations": {
+ "type": "object",
+ "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations"
+ },
+ "ownerReferences": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.OwnerReference"
+ },
+ "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller."
+ },
+ "finalizers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed."
+ },
+ "clusterName": {
+ "type": "string",
+ "description": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request."
+ }
+ }
+ },
+ "v1.OwnerReference": {
+ "id": "v1.OwnerReference",
+ "description": "OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.",
+ "required": [
+ "apiVersion",
+ "kind",
+ "name",
+ "uid"
+ ],
+ "properties": {
+ "apiVersion": {
+ "type": "string",
+ "description": "API version of the referent."
+ },
+ "kind": {
+ "type": "string",
+ "description": "Kind of the referent. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
+ },
+ "uid": {
+ "type": "string",
+ "description": "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
+ },
+ "controller": {
+ "type": "boolean",
+ "description": "If true, this reference points to the managing controller."
+ }
+ }
+ },
+ "v1beta1.PodDisruptionBudgetSpec": {
+ "id": "v1beta1.PodDisruptionBudgetSpec",
+ "description": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
+ "properties": {
+ "minAvailable": {
+ "type": "string",
+ "description": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\"."
+ },
+ "selector": {
+ "$ref": "unversioned.LabelSelector",
+ "description": "Label query over pods whose evictions are managed by the disruption budget."
+ }
+ }
+ },
+ "unversioned.LabelSelector": {
+ "id": "unversioned.LabelSelector",
+ "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
+ "properties": {
+ "matchLabels": {
+ "type": "object",
+ "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed."
+ },
+ "matchExpressions": {
+ "type": "array",
+ "items": {
+ "$ref": "unversioned.LabelSelectorRequirement"
+ },
+ "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
+ }
+ }
+ },
+ "unversioned.LabelSelectorRequirement": {
+ "id": "unversioned.LabelSelectorRequirement",
+ "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
+ "required": [
+ "key",
+ "operator"
+ ],
+ "properties": {
+ "key": {
+ "type": "string",
+ "description": "key is the label key that the selector applies to."
+ },
+ "operator": {
+ "type": "string",
+ "description": "operator represents a key's relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist."
+ },
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch."
+ }
+ }
+ },
+ "v1beta1.PodDisruptionBudgetStatus": {
+ "id": "v1beta1.PodDisruptionBudgetStatus",
+ "description": "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.",
+ "required": [
+ "disruptionsAllowed",
+ "currentHealthy",
+ "desiredHealthy",
+ "expectedPods"
+ ],
+ "properties": {
+ "disruptionsAllowed": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of pod disruptions that are currently allowed."
+ },
+ "currentHealthy": {
+ "type": "integer",
+ "format": "int32",
+ "description": "current number of healthy pods"
+ },
+ "desiredHealthy": {
+ "type": "integer",
+ "format": "int32",
+ "description": "minimum desired number of healthy pods"
+ },
+ "expectedPods": {
+ "type": "integer",
+ "format": "int32",
+ "description": "total number of pods counted by this disruption budget"
+ }
+ }
+ },
+ "unversioned.Status": {
+ "id": "unversioned.Status",
+ "description": "Status is a return value for calls that don't return other objects.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "unversioned.ListMeta",
+ "description": "Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status"
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable description of the status of this operation."
+ },
+ "reason": {
+ "type": "string",
+ "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it."
+ },
+ "details": {
+ "$ref": "unversioned.StatusDetails",
+ "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type."
+ },
+ "code": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Suggested HTTP return code for this status, 0 if not set."
+ }
+ }
+ },
+ "unversioned.StatusDetails": {
+ "id": "unversioned.StatusDetails",
+ "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described)."
+ },
+ "group": {
+ "type": "string",
+ "description": "The group attribute of the resource associated with the status StatusReason."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "causes": {
+ "type": "array",
+ "items": {
+ "$ref": "unversioned.StatusCause"
+ },
+ "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes."
+ },
+ "retryAfterSeconds": {
+ "type": "integer",
+ "format": "int32",
+ "description": "If specified, the time in seconds before the operation should be retried."
+ }
+ }
+ },
+ "unversioned.StatusCause": {
+ "id": "unversioned.StatusCause",
+ "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.",
+ "properties": {
+ "reason": {
+ "type": "string",
+ "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader."
+ },
+ "field": {
+ "type": "string",
+ "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\""
+ }
+ }
+ },
+ "versioned.Event": {
+ "id": "versioned.Event",
+ "required": [
+ "type",
+ "object"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "object": {
+ "type": "string"
+ }
+ }
+ },
+ "unversioned.Patch": {
+ "id": "unversioned.Patch",
+ "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.",
+ "properties": {}
+ },
+ "v1.DeleteOptions": {
+ "id": "v1.DeleteOptions",
+ "description": "DeleteOptions may be provided when deleting an API object",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "gracePeriodSeconds": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately."
+ },
+ "preconditions": {
+ "$ref": "v1.Preconditions",
+ "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
+ },
+ "orphanDependents": {
+ "type": "boolean",
+ "description": "Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list."
+ }
+ }
+ },
+ "v1.Preconditions": {
+ "id": "v1.Preconditions",
+ "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
+ "properties": {
+ "uid": {
+ "$ref": "types.UID",
+ "description": "Specifies the target UID."
+ }
+ }
+ },
+ "types.UID": {
+ "id": "types.UID",
+ "properties": {}
+ },
+ "unversioned.APIResourceList": {
+ "id": "unversioned.APIResourceList",
+ "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.",
+ "required": [
+ "groupVersion",
+ "resources"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "groupVersion": {
+ "type": "string",
+ "description": "groupVersion is the group and version this APIResourceList is for."
+ },
+ "resources": {
+ "type": "array",
+ "items": {
+ "$ref": "unversioned.APIResource"
+ },
+ "description": "resources contains the name of the resources and if they are namespaced."
+ }
+ }
+ },
+ "unversioned.APIResource": {
+ "id": "unversioned.APIResource",
+ "description": "APIResource specifies the name of a resource and whether it is namespaced.",
+ "required": [
+ "name",
+ "namespaced",
+ "kind"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name is the name of the resource."
+ },
+ "namespaced": {
+ "type": "boolean",
+ "description": "namespaced indicates if a resource is namespaced or not."
+ },
+ "kind": {
+ "type": "string",
+ "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')"
+ }
+ }
+ }
+ }
+ }
diff --git a/api/swagger-spec/resourceListing.json b/api/swagger-spec/resourceListing.json
index abe46fad543..a327c4350b9 100644
--- a/api/swagger-spec/resourceListing.json
+++ b/api/swagger-spec/resourceListing.json
@@ -82,8 +82,8 @@
"description": "get information of a group"
},
{
- "path": "/apis/policy/v1alpha1",
- "description": "API at /apis/policy/v1alpha1"
+ "path": "/apis/policy/v1beta1",
+ "description": "API at /apis/policy/v1beta1"
},
{
"path": "/apis/policy",
diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json
index 726754cff3f..d4938fcc584 100644
--- a/api/swagger-spec/v1.json
+++ b/api/swagger-spec/v1.json
@@ -8613,7 +8613,7 @@
"description": "API at /api/v1",
"operations": [
{
- "type": "v1alpha1.Eviction",
+ "type": "v1beta1.Eviction",
"method": "POST",
"summary": "create eviction of an Eviction",
"nickname": "createNamespacedEvictionEviction",
@@ -8627,7 +8627,7 @@
"allowMultiple": false
},
{
- "type": "v1alpha1.Eviction",
+ "type": "v1beta1.Eviction",
"paramType": "body",
"name": "body",
"description": "",
@@ -8655,7 +8655,7 @@
{
"code": 200,
"message": "OK",
- "responseModel": "v1alpha1.Eviction"
+ "responseModel": "v1beta1.Eviction"
}
],
"produces": [
@@ -19038,9 +19038,9 @@
}
}
},
- "v1alpha1.Eviction": {
- "id": "v1alpha1.Eviction",
- "description": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/\u003cpod name\u003e/eviction.",
+ "v1beta1.Eviction": {
+ "id": "v1beta1.Eviction",
+ "description": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/\u003cpod name\u003e/evictions.",
"properties": {
"kind": {
"type": "string",
diff --git a/docs/api-reference/policy/v1alpha1/definitions.html b/docs/api-reference/policy/v1alpha1/definitions.html
index b0d89704b90..54051a89aad 100755
--- a/docs/api-reference/policy/v1alpha1/definitions.html
+++ b/docs/api-reference/policy/v1alpha1/definitions.html
@@ -1388,7 +1388,7 @@ Examples:
+
+
+
+
Top Level API Objects
+
+
+
+
Definitions
+
+
+
v1beta1.PodDisruptionBudget
+
+
PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
+
+
+
+
+
+
unversioned.Patch
+
+
Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
+
+
+
+
v1.DeleteOptions
+
+
DeleteOptions may be provided when deleting an API object
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+kind |
+Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds |
+false |
+string |
+ |
+
+
+apiVersion |
+APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources |
+false |
+string |
+ |
+
+
+gracePeriodSeconds |
+The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. |
+false |
+integer (int64) |
+ |
+
+
+preconditions |
+Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. |
+false |
+v1.Preconditions |
+ |
+
+
+orphanDependents |
+Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. |
+false |
+boolean |
+false |
+
+
+
+
+
+
+
unversioned.StatusDetails
+
+
StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). |
+false |
+string |
+ |
+
+
+group |
+The group attribute of the resource associated with the status StatusReason. |
+false |
+string |
+ |
+
+
+kind |
+The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds |
+false |
+string |
+ |
+
+
+causes |
+The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. |
+false |
+unversioned.StatusCause array |
+ |
+
+
+retryAfterSeconds |
+If specified, the time in seconds before the operation should be retried. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
versioned.Event
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+type |
+ |
+true |
+string |
+ |
+
+
+object |
+ |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+selfLink |
+SelfLink is a URL representing this object. Populated by the system. Read-only. |
+false |
+string |
+ |
+
+
+resourceVersion |
+String that identifies the server’s internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency |
+false |
+string |
+ |
+
+
+
+
+
+
+
v1.Preconditions
+
+
Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+uid |
+Specifies the target UID. |
+false |
+types.UID |
+ |
+
+
+
+
+
+
+
unversioned.LabelSelectorRequirement
+
+
A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+key |
+key is the label key that the selector applies to. |
+true |
+string |
+ |
+
+
+operator |
+operator represents a key’s relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist. |
+true |
+string |
+ |
+
+
+values |
+values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. |
+false |
+string array |
+ |
+
+
+
+
+
+
+
unversioned.APIResourceList
+
+
APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+kind |
+Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds |
+false |
+string |
+ |
+
+
+apiVersion |
+APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources |
+false |
+string |
+ |
+
+
+groupVersion |
+groupVersion is the group and version this APIResourceList is for. |
+true |
+string |
+ |
+
+
+resources |
+resources contains the name of the resources and if they are namespaced. |
+true |
+unversioned.APIResource array |
+ |
+
+
+
+
+
+
+
v1beta1.PodDisruptionBudgetStatus
+
+
PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+disruptionsAllowed |
+Number of pod disruptions that are currently allowed. |
+true |
+integer (int32) |
+ |
+
+
+currentHealthy |
+current number of healthy pods |
+true |
+integer (int32) |
+ |
+
+
+desiredHealthy |
+minimum desired number of healthy pods |
+true |
+integer (int32) |
+ |
+
+
+expectedPods |
+total number of pods counted by this disruption budget |
+true |
+integer (int32) |
+ |
+
+
+
+
+
+
+
unversioned.LabelSelector
+
+
A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+matchLabels |
+matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. |
+false |
+object |
+ |
+
+
+matchExpressions |
+matchExpressions is a list of label selector requirements. The requirements are ANDed. |
+false |
+unversioned.LabelSelectorRequirement array |
+ |
+
+
+
+
+
+
+
v1beta1.PodDisruptionBudgetList
+
+
PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
+
+
+
+
+
+
unversioned.Status
+
+
Status is a return value for calls that don’t return other objects.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+kind |
+Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds |
+false |
+string |
+ |
+
+
+apiVersion |
+APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources |
+false |
+string |
+ |
+
+
+metadata |
+Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds |
+false |
+unversioned.ListMeta |
+ |
+
+
+status |
+Status of the operation. One of: "Success" or "Failure". More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status |
+false |
+string |
+ |
+
+
+message |
+A human-readable description of the status of this operation. |
+false |
+string |
+ |
+
+
+reason |
+A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. |
+false |
+string |
+ |
+
+
+details |
+Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. |
+false |
+unversioned.StatusDetails |
+ |
+
+
+code |
+Suggested HTTP return code for this status, 0 if not set. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
unversioned.APIResource
+
+
APIResource specifies the name of a resource and whether it is namespaced.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+name is the name of the resource. |
+true |
+string |
+ |
+
+
+namespaced |
+namespaced indicates if a resource is namespaced or not. |
+true |
+boolean |
+false |
+
+
+kind |
+kind is the kind for the resource (e.g. Foo is the kind for a resource foo) |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names |
+false |
+string |
+ |
+
+
+generateName |
+GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.
+
+If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).
+
+Applied only if Name is not specified. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency |
+false |
+string |
+ |
+
+
+namespace |
+Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.
+
+Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces |
+false |
+string |
+ |
+
+
+selfLink |
+SelfLink is a URL representing this object. Populated by the system. Read-only. |
+false |
+string |
+ |
+
+
+uid |
+UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.
+
+Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids |
+false |
+string |
+ |
+
+
+resourceVersion |
+An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.
+
+Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency |
+false |
+string |
+ |
+
+
+generation |
+A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. |
+false |
+integer (int64) |
+ |
+
+
+creationTimestamp |
+CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
+
+Populated by the system. Read-only. Null for lists. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata |
+false |
+string (date-time) |
+ |
+
+
+deletionTimestamp |
+DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource will be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet will send a hard termination signal to the container. If not set, graceful deletion of the object has not been requested.
+
+Populated by the system when a graceful deletion is requested. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata |
+false |
+string (date-time) |
+ |
+
+
+deletionGracePeriodSeconds |
+Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. |
+false |
+integer (int64) |
+ |
+
+
+labels |
+Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels |
+false |
+object |
+ |
+
+
+annotations |
+Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations |
+false |
+object |
+ |
+
+
+ownerReferences |
+List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. |
+false |
+v1.OwnerReference array |
+ |
+
+
+finalizers |
+Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. |
+false |
+string array |
+ |
+
+
+clusterName |
+The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. |
+false |
+string |
+ |
+
+
+
+
+
+
+
v1.OwnerReference
+
+
OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.
+
+
+
+
+
+
types.UID
+
+
+
+
unversioned.StatusCause
+
+
StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+reason |
+A machine-readable description of the cause of the error. If this value is empty there is no information available. |
+false |
+string |
+ |
+
+
+message |
+A human-readable description of the cause of the error. This field may be presented as-is to a reader. |
+false |
+string |
+ |
+
+
+field |
+The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.
+
+Examples:
+ "name" - the field "name" on the current resource
+ "items[0].name" - the field "name" on the first array entry in "items" |
+false |
+string |
+ |
+
+
+
+
+
+
+
v1beta1.PodDisruptionBudgetSpec
+
+
PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
+
+
+
+
+
+
+
+
+
+
+
+| Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+minAvailable |
+An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying "100%". |
+false |
+string |
+ |
+
+
+selector |
+Label query over pods whose evictions are managed by the disruption budget. |
+false |
+unversioned.LabelSelector |
+ |
+
+
+
+
+
+
+
any
+
+
Represents an untyped JSON map - see the description of the field for more info about the structure of this object.
+
+
+
+
+
+
+
diff --git a/docs/api-reference/policy/v1alpha1/operations.html b/docs/api-reference/policy/v1alpha1/operations.html
index 4502b04446b..92c7d2ea950 100755
--- a/docs/api-reference/policy/v1alpha1/operations.html
+++ b/docs/api-reference/policy/v1alpha1/operations.html
@@ -2395,7 +2395,11 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
diff --git a/docs/api-reference/policy/v1beta1/definitions.html b/docs/api-reference/policy/v1beta1/definitions.html
new file mode 100755
index 00000000000..393339871e1
--- /dev/null
+++ b/docs/api-reference/policy/v1beta1/definitions.html
@@ -0,0 +1,1395 @@
+
+
+