mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-05-19 00:00:14 +08:00
Merge remote-tracking branch 'origin/master' into release-1.12
Kubernetes-commit: 5f6008cadc6e03bf1c84cae2ef4c239d2a111006
This commit is contained in:
Generated
+72
-72
@@ -172,291 +172,291 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/apps/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/apps/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/apps/v1beta2",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/authentication/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/authentication/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/authorization/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/authorization/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/autoscaling/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/batch/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/batch/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/batch/v2alpha1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/certificates/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/coordination/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/core/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/events/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/extensions/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/networking/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/policy/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/rbac/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/rbac/v1alpha1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/rbac/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/scheduling/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/settings/v1alpha1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/storage/v1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/storage/v1alpha1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api/storage/v1beta1",
|
||||
"Rev": "26126332928c1e87bfc67cba88ac813d6841e11e"
|
||||
"Rev": "888fc6f3af54763c859f0ad7e7e78597e915c703"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
||||
"Rev": "86945f533ab271363f1d115341faadf66ccfe311"
|
||||
"Rev": "bdc400e77b66d73117cdee65710783efca9a45f0"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/client-go/discovery",
|
||||
|
||||
@@ -105,9 +105,8 @@ $ kubectl create -f artifacts/examples/crd-validation.yaml
|
||||
|
||||
## Subresources
|
||||
|
||||
Custom Resources support `/status` and `/scale` subresources as an
|
||||
[alpha feature](https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#subresources) in v1.10.
|
||||
Enable this feature using the `CustomResourceSubresources` feature gate on the [kube-apiserver](https://kubernetes.io/docs/admin/kube-apiserver):
|
||||
Custom Resources support `/status` and `/scale` subresources as a [beta feature](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#subresources) in v1.11 and is enabled by default.
|
||||
This feature is [alpha](https://v1-10.docs.kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#subresources) in v1.10 and to enable it you need to set the `CustomResourceSubresources` feature gate on the [kube-apiserver](https://kubernetes.io/docs/admin/kube-apiserver):
|
||||
|
||||
```sh
|
||||
--feature-gates=CustomResourceSubresources=true
|
||||
|
||||
+1
@@ -151,6 +151,7 @@ message PodDisruptionBudgetStatus {
|
||||
// the list automatically by PodDisruptionBudget controller after some time.
|
||||
// If everything goes smooth this map should be empty for the most of the time.
|
||||
// Large number of entries in the map may indicate problems with pod deletions.
|
||||
// +optional
|
||||
map<string, k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
|
||||
|
||||
// Number of pod disruptions that are currently allowed.
|
||||
|
||||
+2
-1
@@ -60,7 +60,8 @@ type PodDisruptionBudgetStatus struct {
|
||||
// the list automatically by PodDisruptionBudget controller after some time.
|
||||
// If everything goes smooth this map should be empty for the most of the time.
|
||||
// Large number of entries in the map may indicate problems with pod deletions.
|
||||
DisruptedPods map[string]metav1.Time `json:"disruptedPods" protobuf:"bytes,2,rep,name=disruptedPods"`
|
||||
// +optional
|
||||
DisruptedPods map[string]metav1.Time `json:"disruptedPods,omitempty" protobuf:"bytes,2,rep,name=disruptedPods"`
|
||||
|
||||
// Number of pod disruptions that are currently allowed.
|
||||
PodDisruptionsAllowed int32 `json:"disruptionsAllowed" protobuf:"varint,3,opt,name=disruptionsAllowed"`
|
||||
|
||||
+57
-4
@@ -179,6 +179,11 @@ func (u *Unstructured) GetOwnerReferences() []metav1.OwnerReference {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetOwnerReferences(references []metav1.OwnerReference) {
|
||||
if references == nil {
|
||||
RemoveNestedField(u.Object, "metadata", "ownerReferences")
|
||||
return
|
||||
}
|
||||
|
||||
newReferences := make([]interface{}, 0, len(references))
|
||||
for _, reference := range references {
|
||||
out, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&reference)
|
||||
@@ -212,6 +217,10 @@ func (u *Unstructured) GetNamespace() string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetNamespace(namespace string) {
|
||||
if len(namespace) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "namespace")
|
||||
return
|
||||
}
|
||||
u.setNestedField(namespace, "metadata", "namespace")
|
||||
}
|
||||
|
||||
@@ -220,6 +229,10 @@ func (u *Unstructured) GetName() string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetName(name string) {
|
||||
if len(name) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "name")
|
||||
return
|
||||
}
|
||||
u.setNestedField(name, "metadata", "name")
|
||||
}
|
||||
|
||||
@@ -227,8 +240,12 @@ func (u *Unstructured) GetGenerateName() string {
|
||||
return getNestedString(u.Object, "metadata", "generateName")
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetGenerateName(name string) {
|
||||
u.setNestedField(name, "metadata", "generateName")
|
||||
func (u *Unstructured) SetGenerateName(generateName string) {
|
||||
if len(generateName) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "generateName")
|
||||
return
|
||||
}
|
||||
u.setNestedField(generateName, "metadata", "generateName")
|
||||
}
|
||||
|
||||
func (u *Unstructured) GetUID() types.UID {
|
||||
@@ -236,6 +253,10 @@ func (u *Unstructured) GetUID() types.UID {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetUID(uid types.UID) {
|
||||
if len(string(uid)) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "uid")
|
||||
return
|
||||
}
|
||||
u.setNestedField(string(uid), "metadata", "uid")
|
||||
}
|
||||
|
||||
@@ -243,8 +264,12 @@ func (u *Unstructured) GetResourceVersion() string {
|
||||
return getNestedString(u.Object, "metadata", "resourceVersion")
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetResourceVersion(version string) {
|
||||
u.setNestedField(version, "metadata", "resourceVersion")
|
||||
func (u *Unstructured) SetResourceVersion(resourceVersion string) {
|
||||
if len(resourceVersion) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "resourceVersion")
|
||||
return
|
||||
}
|
||||
u.setNestedField(resourceVersion, "metadata", "resourceVersion")
|
||||
}
|
||||
|
||||
func (u *Unstructured) GetGeneration() int64 {
|
||||
@@ -256,6 +281,10 @@ func (u *Unstructured) GetGeneration() int64 {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetGeneration(generation int64) {
|
||||
if generation == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "generation")
|
||||
return
|
||||
}
|
||||
u.setNestedField(generation, "metadata", "generation")
|
||||
}
|
||||
|
||||
@@ -264,6 +293,10 @@ func (u *Unstructured) GetSelfLink() string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetSelfLink(selfLink string) {
|
||||
if len(selfLink) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "selfLink")
|
||||
return
|
||||
}
|
||||
u.setNestedField(selfLink, "metadata", "selfLink")
|
||||
}
|
||||
|
||||
@@ -272,6 +305,10 @@ func (u *Unstructured) GetContinue() string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetContinue(c string) {
|
||||
if len(c) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "continue")
|
||||
return
|
||||
}
|
||||
u.setNestedField(c, "metadata", "continue")
|
||||
}
|
||||
|
||||
@@ -330,6 +367,10 @@ func (u *Unstructured) GetLabels() map[string]string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetLabels(labels map[string]string) {
|
||||
if labels == nil {
|
||||
RemoveNestedField(u.Object, "metadata", "labels")
|
||||
return
|
||||
}
|
||||
u.setNestedMap(labels, "metadata", "labels")
|
||||
}
|
||||
|
||||
@@ -339,6 +380,10 @@ func (u *Unstructured) GetAnnotations() map[string]string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetAnnotations(annotations map[string]string) {
|
||||
if annotations == nil {
|
||||
RemoveNestedField(u.Object, "metadata", "annotations")
|
||||
return
|
||||
}
|
||||
u.setNestedMap(annotations, "metadata", "annotations")
|
||||
}
|
||||
|
||||
@@ -387,6 +432,10 @@ func (u *Unstructured) GetFinalizers() []string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetFinalizers(finalizers []string) {
|
||||
if finalizers == nil {
|
||||
RemoveNestedField(u.Object, "metadata", "finalizers")
|
||||
return
|
||||
}
|
||||
u.setNestedSlice(finalizers, "metadata", "finalizers")
|
||||
}
|
||||
|
||||
@@ -395,5 +444,9 @@ func (u *Unstructured) GetClusterName() string {
|
||||
}
|
||||
|
||||
func (u *Unstructured) SetClusterName(clusterName string) {
|
||||
if len(clusterName) == 0 {
|
||||
RemoveNestedField(u.Object, "metadata", "clusterName")
|
||||
return
|
||||
}
|
||||
u.setNestedField(clusterName, "metadata", "clusterName")
|
||||
}
|
||||
|
||||
+11
@@ -18,6 +18,7 @@ package intstr
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"runtime/debug"
|
||||
@@ -142,7 +143,17 @@ func (intstr *IntOrString) Fuzz(c fuzz.Continue) {
|
||||
}
|
||||
}
|
||||
|
||||
func ValueOrDefault(intOrPercent *IntOrString, defaultValue IntOrString) *IntOrString {
|
||||
if intOrPercent == nil {
|
||||
return &defaultValue
|
||||
}
|
||||
return intOrPercent
|
||||
}
|
||||
|
||||
func GetValueFromIntOrPercent(intOrPercent *IntOrString, total int, roundUp bool) (int, error) {
|
||||
if intOrPercent == nil {
|
||||
return 0, errors.New("nil value for IntOrString")
|
||||
}
|
||||
value, isPercent, err := getIntOrPercentValue(intOrPercent)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("invalid value for IntOrString: %v", err)
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ fi
|
||||
|
||||
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
|
||||
echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/clientset"
|
||||
${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@"
|
||||
${GOPATH}/bin/client-gen --clientset-name ${CLIENTSET_NAME_VERSIONED:-versioned} --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@"
|
||||
fi
|
||||
|
||||
if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then
|
||||
@@ -85,7 +85,7 @@ if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
|
||||
echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers"
|
||||
${GOPATH}/bin/informer-gen \
|
||||
--input-dirs $(codegen::join , "${FQ_APIS[@]}") \
|
||||
--versioned-clientset-package ${OUTPUT_PKG}/clientset/versioned \
|
||||
--versioned-clientset-package ${OUTPUT_PKG}/clientset/${CLIENTSET_NAME_VERSIONED:-versioned} \
|
||||
--listers-package ${OUTPUT_PKG}/listers \
|
||||
--output-package ${OUTPUT_PKG}/informers \
|
||||
"$@"
|
||||
|
||||
+4
-4
@@ -87,9 +87,9 @@ fi
|
||||
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
|
||||
echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/clientset"
|
||||
if [ -n "${INT_APIS_PKG}" ]; then
|
||||
${GOPATH}/bin/client-gen --clientset-name internalversion --input-base "" --input $(codegen::join , $(printf '%s/ ' "${INT_FQ_APIS[@]}")) --output-package ${OUTPUT_PKG}/clientset "$@"
|
||||
${GOPATH}/bin/client-gen --clientset-name ${CLIENTSET_NAME_INTERNAL:-internalversion} --input-base "" --input $(codegen::join , $(printf '%s/ ' "${INT_FQ_APIS[@]}")) --output-package ${OUTPUT_PKG}/clientset "$@"
|
||||
fi
|
||||
${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${EXT_FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@"
|
||||
${GOPATH}/bin/client-gen --clientset-name ${CLIENTSET_NAME_VERSIONED:-versioned} --input-base "" --input $(codegen::join , "${EXT_FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@"
|
||||
fi
|
||||
|
||||
if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then
|
||||
@@ -101,8 +101,8 @@ if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
|
||||
echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers"
|
||||
${GOPATH}/bin/informer-gen \
|
||||
--input-dirs $(codegen::join , "${ALL_FQ_APIS[@]}") \
|
||||
--versioned-clientset-package ${OUTPUT_PKG}/clientset/versioned \
|
||||
--internal-clientset-package ${OUTPUT_PKG}/clientset/internalversion \
|
||||
--versioned-clientset-package ${OUTPUT_PKG}/clientset/${CLIENTSET_NAME_VERSIONED:-versioned} \
|
||||
--internal-clientset-package ${OUTPUT_PKG}/clientset/${CLIENTSET_NAME_INTERNAL:-internalversion} \
|
||||
--listers-package ${OUTPUT_PKG}/listers \
|
||||
--output-package ${OUTPUT_PKG}/informers \
|
||||
"$@"
|
||||
|
||||
Reference in New Issue
Block a user