Merge pull request #54957 from apelisse/update-kube-openapi

Automatic merge from submit-queue (batch tested with PRs 55004, 54957). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update kube-openapi to use validation

**What this PR does / why we need it**: Moves openapi validation code to kube-openapi, so that we can move the rest of the code to apimachinery repository, so that later we can use it from both the client and the server.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #Nothing

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

Kubernetes-commit: 55e216f56eac0082acc6be655d9ae09cf9ba38a8
This commit is contained in:
Kubernetes Publisher 2017-11-02 11:17:33 -07:00
commit 745637cf02
49 changed files with 2527 additions and 1712 deletions

354
Godeps/Godeps.json generated
View File

@ -1,6 +1,6 @@
{
"ImportPath": "k8s.io/sample-controller",
"GoVersion": "go1.8",
"GoVersion": "go1.9",
"GodepVersion": "v79",
"Packages": [
"./..."
@ -240,707 +240,707 @@
},
{
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/apps/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/apps/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/apps/v1beta2",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/authentication/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/authentication/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/authorization/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/authorization/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/autoscaling/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/batch/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/batch/v2alpha1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/certificates/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/core/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/extensions/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/networking/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/policy/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/rbac/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/rbac/v1alpha1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/rbac/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/settings/v1alpha1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/storage/v1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/api/storage/v1beta1",
"Rev": "a302fba76bd80836fb4755b5fb89a1ca0df24c5b"
"Rev": "5fe849133352cb50970c1f89c3a7ffc20b9b73cb"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "9803991b41b5fcfc77691455885b65f7b86ca82a"
"Rev": "423ba1054d2cd0bf9a466a87d8a775e8367d263a"
},
{
"ImportPath": "k8s.io/client-go/discovery",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/discovery/fake",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/admissionregistration",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/admissionregistration/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/apps",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/apps/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/apps/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/apps/v1beta2",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/autoscaling",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/autoscaling/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/batch",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/batch/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/batch/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/batch/v2alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/certificates",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/certificates/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/core",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/core/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/extensions",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/extensions/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/internalinterfaces",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/networking",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/networking/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/policy",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/policy/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/rbac",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/rbac/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/rbac/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/rbac/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/scheduling",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/scheduling/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/settings",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/settings/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/storage",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/storage/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/informers/storage/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/scheme",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta2",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v2alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/certificates/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/extensions/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/networking/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/policy/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/settings/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/admissionregistration/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/apps/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/apps/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/apps/v1beta2",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/autoscaling/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/batch/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/batch/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/batch/v2alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/certificates/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/core/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/extensions/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/networking/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/policy/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/rbac/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/rbac/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/rbac/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/scheduling/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/settings/v1alpha1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/storage/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/listers/storage/v1beta1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/pkg/version",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/rest",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/rest/watch",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/testing",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/auth",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/cache",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/clientcmd",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/clientcmd/api",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/clientcmd/api/latest",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/clientcmd/api/v1",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/metrics",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/pager",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/record",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/tools/reference",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/transport",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/util/buffer",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/util/cert",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/util/flowcontrol",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/util/homedir",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/util/integer",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/client-go/util/workqueue",
"Rev": "dbe8fe09ed1682bc26b4e55cac5ef65dcd7664e9"
"Rev": "60cef58577a58d9a5665f9d6a8d6167930c59174"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/common",
"Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5"
"Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1"
}
]
}

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&DaemonSet{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Deployment{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Deployment{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&TokenReview{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&TokenReview{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&SelfSubjectRulesReview{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&SelfSubjectRulesReview{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&HorizontalPodAutoscaler{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&HorizontalPodAutoscaler{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Job{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&JobTemplate{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&JobTemplate{},

View File

@ -46,7 +46,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&CertificateSigningRequest{},

View File

@ -45,12 +45,6 @@ const (
// to one container of a pod.
SeccompContainerAnnotationKeyPrefix string = "container.seccomp.security.alpha.kubernetes.io/"
// CreatedByAnnotation represents the key used to store the spec(json)
// used to create the resource.
// This field is deprecated in favor of ControllerRef (see #44407).
// TODO(#50720): Remove this field in v1.9.
CreatedByAnnotation = "kubernetes.io/created-by"
// PreferAvoidPodsAnnotationKey represents the key of preferAvoidPods data (json serialized)
// in the Annotations of a Node.
PreferAvoidPodsAnnotationKey string = "scheduler.alpha.kubernetes.io/preferAvoidPods"

File diff suppressed because it is too large Load Diff

View File

@ -765,6 +765,10 @@ message DeleteOptions {
// Either this field or OrphanDependents may be set, but not both.
// The default policy is decided by the existing finalizer set in the
// metadata.finalizers and the resource-specific default policy.
// Acceptable values are: 'Orphan' - orphan the dependents; 'Background' -
// allow the garbage collector to delete the dependents in the background;
// 'Foreground' - a cascading policy that deletes all dependents in the
// foreground.
// +optional
optional string propagationPolicy = 4;
}
@ -2342,7 +2346,7 @@ message PersistentVolumeSource {
// ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
// +optional
optional ScaleIOVolumeSource scaleIO = 19;
optional ScaleIOPersistentVolumeSource scaleIO = 19;
// Local represents directly-attached storage with node affinity
// +optional
@ -3491,6 +3495,50 @@ message SELinuxOptions {
optional string level = 4;
}
// ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume
message ScaleIOPersistentVolumeSource {
// The host address of the ScaleIO API Gateway.
optional string gateway = 1;
// The name of the storage system as configured in ScaleIO.
optional string system = 2;
// SecretRef references to the secret for ScaleIO user and other
// sensitive information. If this is not provided, Login operation will fail.
optional SecretReference secretRef = 3;
// Flag to enable/disable SSL communication with Gateway, default false
// +optional
optional bool sslEnabled = 4;
// The name of the ScaleIO Protection Domain for the configured storage.
// +optional
optional string protectionDomain = 5;
// The ScaleIO Storage Pool associated with the protection domain.
// +optional
optional string storagePool = 6;
// Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// +optional
optional string storageMode = 7;
// The name of a volume already created in the ScaleIO system
// that is associated with this volume source.
optional string volumeName = 8;
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// +optional
optional string fsType = 9;
// Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
optional bool readOnly = 10;
}
// ScaleIOVolumeSource represents a persistent ScaleIO volume
message ScaleIOVolumeSource {
// The host address of the ScaleIO API Gateway.
@ -3507,15 +3555,15 @@ message ScaleIOVolumeSource {
// +optional
optional bool sslEnabled = 4;
// The name of the Protection Domain for the configured storage (defaults to "default").
// The name of the ScaleIO Protection Domain for the configured storage.
// +optional
optional string protectionDomain = 5;
// The Storage Pool associated with the protection domain (defaults to "default").
// The ScaleIO Storage Pool associated with the protection domain.
// +optional
optional string storagePool = 6;
// Indicates whether the storage for a volume should be thick or thin (defaults to "thin").
// Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// +optional
optional string storageMode = 7;

View File

@ -43,7 +43,7 @@ var (
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Pod{},

49
vendor/k8s.io/api/core/v1/types.go generated vendored
View File

@ -440,7 +440,7 @@ type PersistentVolumeSource struct {
PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,18,opt,name=portworxVolume"`
// ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
// +optional
ScaleIO *ScaleIOVolumeSource `json:"scaleIO,omitempty" protobuf:"bytes,19,opt,name=scaleIO"`
ScaleIO *ScaleIOPersistentVolumeSource `json:"scaleIO,omitempty" protobuf:"bytes,19,opt,name=scaleIO"`
// Local represents directly-attached storage with node affinity
// +optional
Local *LocalVolumeSource `json:"local,omitempty" protobuf:"bytes,20,opt,name=local"`
@ -989,7 +989,7 @@ type StorageMedium string
const (
StorageMediumDefault StorageMedium = "" // use whatever the default is for the node
StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs)
StorageMediumHugepages StorageMedium = "HugePages" // use hugepages
StorageMediumHugePages StorageMedium = "HugePages" // use hugepages
)
// Protocol defines network protocols supported for things like container ports.
@ -1396,13 +1396,48 @@ type ScaleIOVolumeSource struct {
// Flag to enable/disable SSL communication with Gateway, default false
// +optional
SSLEnabled bool `json:"sslEnabled,omitempty" protobuf:"varint,4,opt,name=sslEnabled"`
// The name of the Protection Domain for the configured storage (defaults to "default").
// The name of the ScaleIO Protection Domain for the configured storage.
// +optional
ProtectionDomain string `json:"protectionDomain,omitempty" protobuf:"bytes,5,opt,name=protectionDomain"`
// The Storage Pool associated with the protection domain (defaults to "default").
// The ScaleIO Storage Pool associated with the protection domain.
// +optional
StoragePool string `json:"storagePool,omitempty" protobuf:"bytes,6,opt,name=storagePool"`
// Indicates whether the storage for a volume should be thick or thin (defaults to "thin").
// Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// +optional
StorageMode string `json:"storageMode,omitempty" protobuf:"bytes,7,opt,name=storageMode"`
// The name of a volume already created in the ScaleIO system
// that is associated with this volume source.
VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,8,opt,name=volumeName"`
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// +optional
FSType string `json:"fsType,omitempty" protobuf:"bytes,9,opt,name=fsType"`
// Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,10,opt,name=readOnly"`
}
// ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume
type ScaleIOPersistentVolumeSource struct {
// The host address of the ScaleIO API Gateway.
Gateway string `json:"gateway" protobuf:"bytes,1,opt,name=gateway"`
// The name of the storage system as configured in ScaleIO.
System string `json:"system" protobuf:"bytes,2,opt,name=system"`
// SecretRef references to the secret for ScaleIO user and other
// sensitive information. If this is not provided, Login operation will fail.
SecretRef *SecretReference `json:"secretRef" protobuf:"bytes,3,opt,name=secretRef"`
// Flag to enable/disable SSL communication with Gateway, default false
// +optional
SSLEnabled bool `json:"sslEnabled,omitempty" protobuf:"varint,4,opt,name=sslEnabled"`
// The name of the ScaleIO Protection Domain for the configured storage.
// +optional
ProtectionDomain string `json:"protectionDomain,omitempty" protobuf:"bytes,5,opt,name=protectionDomain"`
// The ScaleIO Storage Pool associated with the protection domain.
// +optional
StoragePool string `json:"storagePool,omitempty" protobuf:"bytes,6,opt,name=storagePool"`
// Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// +optional
StorageMode string `json:"storageMode,omitempty" protobuf:"bytes,7,opt,name=storageMode"`
// The name of a volume already created in the ScaleIO system
@ -3999,6 +4034,10 @@ type DeleteOptions struct {
// Either this field or OrphanDependents may be set, but not both.
// The default policy is decided by the existing finalizer set in the
// metadata.finalizers and the resource-specific default policy.
// Acceptable values are: 'Orphan' - orphan the dependents; 'Background' -
// allow the garbage collector to delete the dependents in the background;
// 'Foreground' - a cascading policy that deletes all dependents in the
// foreground.
// +optional
PropagationPolicy *DeletionPropagation `protobuf:"bytes,4,opt,name=propagationPolicy,casttype=DeletionPropagation"`
}

View File

@ -392,7 +392,7 @@ var map_DeleteOptions = map[string]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.",
"preconditions": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.",
"orphanDependents": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
"PropagationPolicy": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.",
"PropagationPolicy": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
}
func (DeleteOptions) SwaggerDoc() map[string]string {
@ -1748,15 +1748,33 @@ func (SELinuxOptions) SwaggerDoc() map[string]string {
return map_SELinuxOptions
}
var map_ScaleIOPersistentVolumeSource = map[string]string{
"": "ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume",
"gateway": "The host address of the ScaleIO API Gateway.",
"system": "The name of the storage system as configured in ScaleIO.",
"secretRef": "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.",
"sslEnabled": "Flag to enable/disable SSL communication with Gateway, default false",
"protectionDomain": "The name of the ScaleIO Protection Domain for the configured storage.",
"storagePool": "The ScaleIO Storage Pool associated with the protection domain.",
"storageMode": "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.",
"volumeName": "The name of a volume already created in the ScaleIO system that is associated with this volume source.",
"fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
"readOnly": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.",
}
func (ScaleIOPersistentVolumeSource) SwaggerDoc() map[string]string {
return map_ScaleIOPersistentVolumeSource
}
var map_ScaleIOVolumeSource = map[string]string{
"": "ScaleIOVolumeSource represents a persistent ScaleIO volume",
"gateway": "The host address of the ScaleIO API Gateway.",
"system": "The name of the storage system as configured in ScaleIO.",
"secretRef": "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.",
"sslEnabled": "Flag to enable/disable SSL communication with Gateway, default false",
"protectionDomain": "The name of the Protection Domain for the configured storage (defaults to \"default\").",
"storagePool": "The Storage Pool associated with the protection domain (defaults to \"default\").",
"storageMode": "Indicates whether the storage for a volume should be thick or thin (defaults to \"thin\").",
"protectionDomain": "The name of the ScaleIO Protection Domain for the configured storage.",
"storagePool": "The ScaleIO Storage Pool associated with the protection domain.",
"storageMode": "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.",
"volumeName": "The name of a volume already created in the ScaleIO system that is associated with this volume source.",
"fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
"readOnly": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.",

View File

@ -631,6 +631,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*SELinuxOptions).DeepCopyInto(out.(*SELinuxOptions))
return nil
}, InType: reflect.TypeOf(&SELinuxOptions{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ScaleIOPersistentVolumeSource).DeepCopyInto(out.(*ScaleIOPersistentVolumeSource))
return nil
}, InType: reflect.TypeOf(&ScaleIOPersistentVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ScaleIOVolumeSource).DeepCopyInto(out.(*ScaleIOVolumeSource))
return nil
@ -3854,7 +3858,7 @@ func (in *PersistentVolumeSource) DeepCopyInto(out *PersistentVolumeSource) {
if *in == nil {
*out = nil
} else {
*out = new(ScaleIOVolumeSource)
*out = new(ScaleIOPersistentVolumeSource)
(*in).DeepCopyInto(*out)
}
}
@ -5225,6 +5229,31 @@ func (in *SELinuxOptions) DeepCopy() *SELinuxOptions {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScaleIOPersistentVolumeSource) DeepCopyInto(out *ScaleIOPersistentVolumeSource) {
*out = *in
if in.SecretRef != nil {
in, out := &in.SecretRef, &out.SecretRef
if *in == nil {
*out = nil
} else {
*out = new(SecretReference)
**out = **in
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleIOPersistentVolumeSource.
func (in *ScaleIOPersistentVolumeSource) DeepCopy() *ScaleIOPersistentVolumeSource {
if in == nil {
return nil
}
out := new(ScaleIOPersistentVolumeSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScaleIOVolumeSource) DeepCopyInto(out *ScaleIOVolumeSource) {
*out = *in

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Deployment{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&NetworkPolicy{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&PodDisruptionBudget{},

View File

@ -40,7 +40,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Role{},

View File

@ -40,7 +40,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Role{},

View File

@ -40,7 +40,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Role{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&PriorityClass{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&PodPreset{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&StorageClass{},

View File

@ -41,7 +41,7 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&StorageClass{},

View File

@ -405,84 +405,84 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr
// IsNotFound returns true if the specified error was created by NewNotFound.
func IsNotFound(err error) bool {
return reasonForError(err) == metav1.StatusReasonNotFound
return ReasonForError(err) == metav1.StatusReasonNotFound
}
// IsAlreadyExists determines if the err is an error which indicates that a specified resource already exists.
func IsAlreadyExists(err error) bool {
return reasonForError(err) == metav1.StatusReasonAlreadyExists
return ReasonForError(err) == metav1.StatusReasonAlreadyExists
}
// IsConflict determines if the err is an error which indicates the provided update conflicts.
func IsConflict(err error) bool {
return reasonForError(err) == metav1.StatusReasonConflict
return ReasonForError(err) == metav1.StatusReasonConflict
}
// IsInvalid determines if the err is an error which indicates the provided resource is not valid.
func IsInvalid(err error) bool {
return reasonForError(err) == metav1.StatusReasonInvalid
return ReasonForError(err) == metav1.StatusReasonInvalid
}
// IsGone is true if the error indicates the requested resource is no longer available.
func IsGone(err error) bool {
return reasonForError(err) == metav1.StatusReasonGone
return ReasonForError(err) == metav1.StatusReasonGone
}
// IsResourceExpired is true if the error indicates the resource has expired and the current action is
// no longer possible.
func IsResourceExpired(err error) bool {
return reasonForError(err) == metav1.StatusReasonExpired
return ReasonForError(err) == metav1.StatusReasonExpired
}
// IsMethodNotSupported determines if the err is an error which indicates the provided action could not
// be performed because it is not supported by the server.
func IsMethodNotSupported(err error) bool {
return reasonForError(err) == metav1.StatusReasonMethodNotAllowed
return ReasonForError(err) == metav1.StatusReasonMethodNotAllowed
}
// IsServiceUnavailable is true if the error indicates the underlying service is no longer available.
func IsServiceUnavailable(err error) bool {
return reasonForError(err) == metav1.StatusReasonServiceUnavailable
return ReasonForError(err) == metav1.StatusReasonServiceUnavailable
}
// IsBadRequest determines if err is an error which indicates that the request is invalid.
func IsBadRequest(err error) bool {
return reasonForError(err) == metav1.StatusReasonBadRequest
return ReasonForError(err) == metav1.StatusReasonBadRequest
}
// IsUnauthorized determines if err is an error which indicates that the request is unauthorized and
// requires authentication by the user.
func IsUnauthorized(err error) bool {
return reasonForError(err) == metav1.StatusReasonUnauthorized
return ReasonForError(err) == metav1.StatusReasonUnauthorized
}
// IsForbidden determines if err is an error which indicates that the request is forbidden and cannot
// be completed as requested.
func IsForbidden(err error) bool {
return reasonForError(err) == metav1.StatusReasonForbidden
return ReasonForError(err) == metav1.StatusReasonForbidden
}
// IsTimeout determines if err is an error which indicates that request times out due to long
// processing.
func IsTimeout(err error) bool {
return reasonForError(err) == metav1.StatusReasonTimeout
return ReasonForError(err) == metav1.StatusReasonTimeout
}
// IsServerTimeout determines if err is an error which indicates that the request needs to be retried
// by the client.
func IsServerTimeout(err error) bool {
return reasonForError(err) == metav1.StatusReasonServerTimeout
return ReasonForError(err) == metav1.StatusReasonServerTimeout
}
// IsInternalError determines if err is an error which indicates an internal server error.
func IsInternalError(err error) bool {
return reasonForError(err) == metav1.StatusReasonInternalError
return ReasonForError(err) == metav1.StatusReasonInternalError
}
// IsTooManyRequests determines if err is an error which indicates that there are too many requests
// that the server cannot handle.
func IsTooManyRequests(err error) bool {
if reasonForError(err) == metav1.StatusReasonTooManyRequests {
if ReasonForError(err) == metav1.StatusReasonTooManyRequests {
return true
}
switch t := err.(type) {
@ -536,7 +536,8 @@ func SuggestsClientDelay(err error) (int, bool) {
return 0, false
}
func reasonForError(err error) metav1.StatusReason {
// ReasonForError returns the HTTP status for a particular error.
func ReasonForError(err error) metav1.StatusReason {
switch t := err.(type) {
case APIStatus:
return t.Status().Reason

View File

@ -75,6 +75,9 @@ type MetadataAccessor interface {
Annotations(obj runtime.Object) (map[string]string, error)
SetAnnotations(obj runtime.Object, annotations map[string]string) error
Continue(obj runtime.Object) (string, error)
SetContinue(obj runtime.Object, c string) error
runtime.ResourceVersioner
}

View File

@ -367,6 +367,23 @@ func (resourceAccessor) SetResourceVersion(obj runtime.Object, version string) e
return nil
}
func (resourceAccessor) Continue(obj runtime.Object) (string, error) {
accessor, err := ListAccessor(obj)
if err != nil {
return "", err
}
return accessor.GetContinue(), nil
}
func (resourceAccessor) SetContinue(obj runtime.Object, version string) error {
accessor, err := ListAccessor(obj)
if err != nil {
return err
}
accessor.SetContinue(version)
return nil
}
// extractFromOwnerReference extracts v to o. v is the OwnerReferences field of an object.
func extractFromOwnerReference(v reflect.Value, o *metav1.OwnerReference) error {
if err := runtime.Field(v, "APIVersion", &o.APIVersion); err != nil {

View File

@ -149,6 +149,10 @@ message DeleteOptions {
// Either this field or OrphanDependents may be set, but not both.
// The default policy is decided by the existing finalizer set in the
// metadata.finalizers and the resource-specific default policy.
// Acceptable values are: 'Orphan' - orphan the dependents; 'Background' -
// allow the garbage collector to delete the dependents in the background;
// 'Foreground' - a cascading policy that deletes all dependents in the
// foreground.
// +optional
optional string propagationPolicy = 4;
}

View File

@ -445,6 +445,10 @@ type DeleteOptions struct {
// Either this field or OrphanDependents may be set, but not both.
// The default policy is decided by the existing finalizer set in the
// metadata.finalizers and the resource-specific default policy.
// Acceptable values are: 'Orphan' - orphan the dependents; 'Background' -
// allow the garbage collector to delete the dependents in the background;
// 'Foreground' - a cascading policy that deletes all dependents in the
// foreground.
// +optional
PropagationPolicy *DeletionPropagation `json:"propagationPolicy,omitempty" protobuf:"varint,4,opt,name=propagationPolicy"`
}

View File

@ -90,7 +90,7 @@ var map_DeleteOptions = map[string]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.",
"preconditions": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.",
"orphanDependents": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
"propagationPolicy": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.",
"propagationPolicy": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
}
func (DeleteOptions) SwaggerDoc() map[string]string {

View File

@ -8,21 +8,29 @@ load(
go_test(
name = "go_default_test",
srcs = ["unstructured_test.go"],
srcs = [
"helpers_test.go",
"unstructured_list_test.go",
],
importpath = "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
library = ":go_default_library",
deps = ["//vendor/github.com/stretchr/testify/assert:go_default_library"],
deps = [
"//vendor/github.com/stretchr/testify/assert:go_default_library",
"//vendor/github.com/stretchr/testify/require:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
],
)
go_library(
name = "go_default_library",
srcs = [
"helpers.go",
"unstructured.go",
"unstructured_list.go",
"zz_generated.deepcopy.go",
],
importpath = "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
deps = [
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/conversion/unstructured:go_default_library",

View File

@ -0,0 +1,470 @@
/*
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 unstructured
import (
gojson "encoding/json"
"errors"
"fmt"
"io"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/conversion/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/json"
)
// NestedFieldCopy returns a deep copy of the value of a nested field.
// false is returned if the value is missing.
// nil, true is returned for a nil field.
func NestedFieldCopy(obj map[string]interface{}, fields ...string) (interface{}, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return nil, false
}
return unstructured.DeepCopyJSONValue(val), true
}
func nestedFieldNoCopy(obj map[string]interface{}, fields ...string) (interface{}, bool) {
var val interface{} = obj
for _, field := range fields {
if m, ok := val.(map[string]interface{}); ok {
val, ok = m[field]
if !ok {
return nil, false
}
} else {
// Expected map[string]interface{}, got something else
return nil, false
}
}
return val, true
}
// NestedString returns the string value of a nested field.
// Returns false if value is not found or is not a string.
func NestedString(obj map[string]interface{}, fields ...string) (string, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return "", false
}
s, ok := val.(string)
return s, ok
}
// NestedBool returns the bool value of a nested field.
// Returns false if value is not found or is not a bool.
func NestedBool(obj map[string]interface{}, fields ...string) (bool, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return false, false
}
b, ok := val.(bool)
return b, ok
}
// NestedFloat64 returns the bool value of a nested field.
// Returns false if value is not found or is not a float64.
func NestedFloat64(obj map[string]interface{}, fields ...string) (float64, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return 0, false
}
f, ok := val.(float64)
return f, ok
}
// NestedInt64 returns the int64 value of a nested field.
// Returns false if value is not found or is not an int64.
func NestedInt64(obj map[string]interface{}, fields ...string) (int64, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return 0, false
}
i, ok := val.(int64)
return i, ok
}
// NestedStringSlice returns a copy of []string value of a nested field.
// Returns false if value is not found, is not a []interface{} or contains non-string items in the slice.
func NestedStringSlice(obj map[string]interface{}, fields ...string) ([]string, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return nil, false
}
if m, ok := val.([]interface{}); ok {
strSlice := make([]string, 0, len(m))
for _, v := range m {
if str, ok := v.(string); ok {
strSlice = append(strSlice, str)
} else {
return nil, false
}
}
return strSlice, true
}
return nil, false
}
// NestedSlice returns a deep copy of []interface{} value of a nested field.
// Returns false if value is not found or is not a []interface{}.
func NestedSlice(obj map[string]interface{}, fields ...string) ([]interface{}, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return nil, false
}
if _, ok := val.([]interface{}); ok {
return unstructured.DeepCopyJSONValue(val).([]interface{}), true
}
return nil, false
}
// NestedStringMap returns a copy of map[string]string value of a nested field.
// Returns false if value is not found, is not a map[string]interface{} or contains non-string values in the map.
func NestedStringMap(obj map[string]interface{}, fields ...string) (map[string]string, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return nil, false
}
if m, ok := val.(map[string]interface{}); ok {
strMap := make(map[string]string, len(m))
for k, v := range m {
if str, ok := v.(string); ok {
strMap[k] = str
} else {
return nil, false
}
}
return strMap, true
}
return nil, false
}
// NestedMap returns a deep copy of map[string]interface{} value of a nested field.
// Returns false if value is not found or is not a map[string]interface{}.
func NestedMap(obj map[string]interface{}, fields ...string) (map[string]interface{}, bool) {
val, ok := nestedFieldNoCopy(obj, fields...)
if !ok {
return nil, false
}
if m, ok := val.(map[string]interface{}); ok {
return unstructured.DeepCopyJSON(m), true
}
return nil, false
}
// SetNestedField sets the value of a nested field to a deep copy of the value provided.
// Returns false if value cannot be set because one of the nesting levels is not a map[string]interface{}.
func SetNestedField(obj map[string]interface{}, value interface{}, fields ...string) bool {
return setNestedFieldNoCopy(obj, unstructured.DeepCopyJSONValue(value), fields...)
}
func setNestedFieldNoCopy(obj map[string]interface{}, value interface{}, fields ...string) bool {
m := obj
for _, field := range fields[:len(fields)-1] {
if val, ok := m[field]; ok {
if valMap, ok := val.(map[string]interface{}); ok {
m = valMap
} else {
return false
}
} else {
newVal := make(map[string]interface{})
m[field] = newVal
m = newVal
}
}
m[fields[len(fields)-1]] = value
return true
}
// SetNestedStringSlice sets the string slice value of a nested field.
// Returns false if value cannot be set because one of the nesting levels is not a map[string]interface{}.
func SetNestedStringSlice(obj map[string]interface{}, value []string, fields ...string) bool {
m := make([]interface{}, 0, len(value)) // convert []string into []interface{}
for _, v := range value {
m = append(m, v)
}
return setNestedFieldNoCopy(obj, m, fields...)
}
// SetNestedSlice sets the slice value of a nested field.
// Returns false if value cannot be set because one of the nesting levels is not a map[string]interface{}.
func SetNestedSlice(obj map[string]interface{}, value []interface{}, fields ...string) bool {
return SetNestedField(obj, value, fields...)
}
// SetNestedStringMap sets the map[string]string value of a nested field.
// Returns false if value cannot be set because one of the nesting levels is not a map[string]interface{}.
func SetNestedStringMap(obj map[string]interface{}, value map[string]string, fields ...string) bool {
m := make(map[string]interface{}, len(value)) // convert map[string]string into map[string]interface{}
for k, v := range value {
m[k] = v
}
return setNestedFieldNoCopy(obj, m, fields...)
}
// SetNestedMap sets the map[string]interface{} value of a nested field.
// Returns false if value cannot be set because one of the nesting levels is not a map[string]interface{}.
func SetNestedMap(obj map[string]interface{}, value map[string]interface{}, fields ...string) bool {
return SetNestedField(obj, value, fields...)
}
// RemoveNestedField removes the nested field from the obj.
func RemoveNestedField(obj map[string]interface{}, fields ...string) {
m := obj
for _, field := range fields[:len(fields)-1] {
if x, ok := m[field].(map[string]interface{}); ok {
m = x
} else {
return
}
}
delete(m, fields[len(fields)-1])
}
func getNestedString(obj map[string]interface{}, fields ...string) string {
val, ok := NestedString(obj, fields...)
if !ok {
return ""
}
return val
}
func extractOwnerReference(v map[string]interface{}) metav1.OwnerReference {
// though this field is a *bool, but when decoded from JSON, it's
// unmarshalled as bool.
var controllerPtr *bool
if controller, ok := NestedBool(v, "controller"); ok {
controllerPtr = &controller
}
var blockOwnerDeletionPtr *bool
if blockOwnerDeletion, ok := NestedBool(v, "blockOwnerDeletion"); ok {
blockOwnerDeletionPtr = &blockOwnerDeletion
}
return metav1.OwnerReference{
Kind: getNestedString(v, "kind"),
Name: getNestedString(v, "name"),
APIVersion: getNestedString(v, "apiVersion"),
UID: types.UID(getNestedString(v, "uid")),
Controller: controllerPtr,
BlockOwnerDeletion: blockOwnerDeletionPtr,
}
}
func setOwnerReference(src metav1.OwnerReference) map[string]interface{} {
ret := map[string]interface{}{
"kind": src.Kind,
"name": src.Name,
"apiVersion": src.APIVersion,
"uid": string(src.UID),
}
// json.Unmarshal() extracts boolean json fields as bool, not as *bool and hence extractOwnerReference()
// expects bool or a missing field, not *bool. So if pointer is nil, fields are omitted from the ret object.
// If pointer is non-nil, they are set to the referenced value.
if src.Controller != nil {
ret["controller"] = *src.Controller
}
if src.BlockOwnerDeletion != nil {
ret["blockOwnerDeletion"] = *src.BlockOwnerDeletion
}
return ret
}
var converter = unstructured.NewConverter(false)
// UnstructuredJSONScheme is capable of converting JSON data into the Unstructured
// type, which can be used for generic access to objects without a predefined scheme.
// TODO: move into serializer/json.
var UnstructuredJSONScheme runtime.Codec = unstructuredJSONScheme{}
type unstructuredJSONScheme struct{}
func (s unstructuredJSONScheme) Decode(data []byte, _ *schema.GroupVersionKind, obj runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
var err error
if obj != nil {
err = s.decodeInto(data, obj)
} else {
obj, err = s.decode(data)
}
if err != nil {
return nil, nil, err
}
gvk := obj.GetObjectKind().GroupVersionKind()
if len(gvk.Kind) == 0 {
return nil, &gvk, runtime.NewMissingKindErr(string(data))
}
return obj, &gvk, nil
}
func (unstructuredJSONScheme) Encode(obj runtime.Object, w io.Writer) error {
switch t := obj.(type) {
case *Unstructured:
return json.NewEncoder(w).Encode(t.Object)
case *UnstructuredList:
items := make([]interface{}, 0, len(t.Items))
for _, i := range t.Items {
items = append(items, i.Object)
}
listObj := make(map[string]interface{}, len(t.Object)+1)
for k, v := range t.Object { // Make a shallow copy
listObj[k] = v
}
listObj["items"] = items
return json.NewEncoder(w).Encode(listObj)
case *runtime.Unknown:
// TODO: Unstructured needs to deal with ContentType.
_, err := w.Write(t.Raw)
return err
default:
return json.NewEncoder(w).Encode(t)
}
}
func (s unstructuredJSONScheme) decode(data []byte) (runtime.Object, error) {
type detector struct {
Items gojson.RawMessage
}
var det detector
if err := json.Unmarshal(data, &det); err != nil {
return nil, err
}
if det.Items != nil {
list := &UnstructuredList{}
err := s.decodeToList(data, list)
return list, err
}
// No Items field, so it wasn't a list.
unstruct := &Unstructured{}
err := s.decodeToUnstructured(data, unstruct)
return unstruct, err
}
func (s unstructuredJSONScheme) decodeInto(data []byte, obj runtime.Object) error {
switch x := obj.(type) {
case *Unstructured:
return s.decodeToUnstructured(data, x)
case *UnstructuredList:
return s.decodeToList(data, x)
case *runtime.VersionedObjects:
o, err := s.decode(data)
if err == nil {
x.Objects = []runtime.Object{o}
}
return err
default:
return json.Unmarshal(data, x)
}
}
func (unstructuredJSONScheme) decodeToUnstructured(data []byte, unstruct *Unstructured) error {
m := make(map[string]interface{})
if err := json.Unmarshal(data, &m); err != nil {
return err
}
unstruct.Object = m
return nil
}
func (s unstructuredJSONScheme) decodeToList(data []byte, list *UnstructuredList) error {
type decodeList struct {
Items []gojson.RawMessage
}
var dList decodeList
if err := json.Unmarshal(data, &dList); err != nil {
return err
}
if err := json.Unmarshal(data, &list.Object); err != nil {
return err
}
// For typed lists, e.g., a PodList, API server doesn't set each item's
// APIVersion and Kind. We need to set it.
listAPIVersion := list.GetAPIVersion()
listKind := list.GetKind()
itemKind := strings.TrimSuffix(listKind, "List")
delete(list.Object, "items")
list.Items = make([]Unstructured, 0, len(dList.Items))
for _, i := range dList.Items {
unstruct := &Unstructured{}
if err := s.decodeToUnstructured([]byte(i), unstruct); err != nil {
return err
}
// This is hacky. Set the item's Kind and APIVersion to those inferred
// from the List.
if len(unstruct.GetKind()) == 0 && len(unstruct.GetAPIVersion()) == 0 {
unstruct.SetKind(itemKind)
unstruct.SetAPIVersion(listAPIVersion)
}
list.Items = append(list.Items, *unstruct)
}
return nil
}
// UnstructuredObjectConverter is an ObjectConverter for use with
// Unstructured objects. Since it has no schema or type information,
// it will only succeed for no-op conversions. This is provided as a
// sane implementation for APIs that require an object converter.
type UnstructuredObjectConverter struct{}
func (UnstructuredObjectConverter) Convert(in, out, context interface{}) error {
unstructIn, ok := in.(*Unstructured)
if !ok {
return fmt.Errorf("input type %T in not valid for unstructured conversion", in)
}
unstructOut, ok := out.(*Unstructured)
if !ok {
return fmt.Errorf("output type %T in not valid for unstructured conversion", out)
}
// maybe deep copy the map? It is documented in the
// ObjectConverter interface that this function is not
// guaranteeed to not mutate the input. Or maybe set the input
// object to nil.
unstructOut.Object = unstructIn.Object
return nil
}
func (UnstructuredObjectConverter) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) {
if kind := in.GetObjectKind().GroupVersionKind(); !kind.Empty() {
gvk, ok := target.KindForGroupVersionKinds([]schema.GroupVersionKind{kind})
if !ok {
// TODO: should this be a typed error?
return nil, fmt.Errorf("%v is unstructured and is not suitable for converting to %q", kind, target)
}
in.GetObjectKind().SetGroupVersionKind(gvk)
}
return in, nil
}
func (UnstructuredObjectConverter) ConvertFieldLabel(version, kind, label, value string) (string, string, error) {
return "", "", errors.New("unstructured cannot convert field labels")
}

View File

@ -18,20 +18,13 @@ package unstructured
import (
"bytes"
gojson "encoding/json"
"errors"
"fmt"
"io"
"strings"
"github.com/golang/glog"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/conversion/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/json"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
@ -54,13 +47,10 @@ type Unstructured struct {
var _ metav1.Object = &Unstructured{}
var _ runtime.Unstructured = &Unstructured{}
var _ runtime.Unstructured = &UnstructuredList{}
func (obj *Unstructured) GetObjectKind() schema.ObjectKind { return obj }
func (obj *UnstructuredList) GetObjectKind() schema.ObjectKind { return obj }
func (obj *Unstructured) GetObjectKind() schema.ObjectKind { return obj }
func (obj *Unstructured) IsUnstructuredObject() {}
func (obj *UnstructuredList) IsUnstructuredObject() {}
func (obj *Unstructured) IsUnstructuredObject() {}
func (obj *Unstructured) IsList() bool {
if obj.Object != nil {
@ -69,7 +59,6 @@ func (obj *Unstructured) IsList() bool {
}
return false
}
func (obj *UnstructuredList) IsList() bool { return true }
func (obj *Unstructured) EachListItem(fn func(runtime.Object) error) error {
if obj.Object == nil {
@ -95,15 +84,6 @@ func (obj *Unstructured) EachListItem(fn func(runtime.Object) error) error {
return nil
}
func (obj *UnstructuredList) EachListItem(fn func(runtime.Object) error) error {
for i := range obj.Items {
if err := fn(&obj.Items[i]); err != nil {
return err
}
}
return nil
}
func (obj *Unstructured) UnstructuredContent() map[string]interface{} {
if obj.Object == nil {
obj.Object = make(map[string]interface{})
@ -111,25 +91,6 @@ func (obj *Unstructured) UnstructuredContent() map[string]interface{} {
return obj.Object
}
// UnstructuredContent returns a map contain an overlay of the Items field onto
// the Object field. Items always overwrites overlay. Changing "items" in the
// returned object will affect items in the underlying Items field, but changing
// the "items" slice itself will have no effect.
// TODO: expose SetUnstructuredContent on runtime.Unstructured that allows
// items to be changed.
func (obj *UnstructuredList) UnstructuredContent() map[string]interface{} {
out := obj.Object
if out == nil {
out = make(map[string]interface{})
}
items := make([]interface{}, len(obj.Items))
for i, item := range obj.Items {
items[i] = item.Object
}
out["items"] = items
return out
}
// MarshalJSON ensures that the unstructured object produces proper
// JSON when passed to Go's standard JSON library.
func (u *Unstructured) MarshalJSON() ([]byte, error) {
@ -155,223 +116,52 @@ func (in *Unstructured) DeepCopy() *Unstructured {
return out
}
func (in *UnstructuredList) DeepCopy() *UnstructuredList {
if in == nil {
return nil
}
out := new(UnstructuredList)
*out = *in
out.Object = unstructured.DeepCopyJSON(in.Object)
out.Items = make([]Unstructured, len(in.Items))
for i := range in.Items {
in.Items[i].DeepCopyInto(&out.Items[i])
}
return out
}
func getNestedField(obj map[string]interface{}, fields ...string) interface{} {
var val interface{} = obj
for _, field := range fields {
if _, ok := val.(map[string]interface{}); !ok {
return nil
}
val = val.(map[string]interface{})[field]
}
return val
}
func getNestedString(obj map[string]interface{}, fields ...string) string {
if str, ok := getNestedField(obj, fields...).(string); ok {
return str
}
return ""
}
func getNestedInt64(obj map[string]interface{}, fields ...string) int64 {
if str, ok := getNestedField(obj, fields...).(int64); ok {
return str
}
return 0
}
func getNestedInt64Pointer(obj map[string]interface{}, fields ...string) *int64 {
nested := getNestedField(obj, fields...)
switch n := nested.(type) {
case int64:
return &n
case *int64:
return n
default:
return nil
}
}
func getNestedSlice(obj map[string]interface{}, fields ...string) []string {
if m, ok := getNestedField(obj, fields...).([]interface{}); ok {
strSlice := make([]string, 0, len(m))
for _, v := range m {
if str, ok := v.(string); ok {
strSlice = append(strSlice, str)
}
}
return strSlice
}
return nil
}
func getNestedMap(obj map[string]interface{}, fields ...string) map[string]string {
if m, ok := getNestedField(obj, fields...).(map[string]interface{}); ok {
strMap := make(map[string]string, len(m))
for k, v := range m {
if str, ok := v.(string); ok {
strMap[k] = str
}
}
return strMap
}
return nil
}
func setNestedField(obj map[string]interface{}, value interface{}, fields ...string) {
m := obj
if len(fields) > 1 {
for _, field := range fields[0 : len(fields)-1] {
if _, ok := m[field].(map[string]interface{}); !ok {
m[field] = make(map[string]interface{})
}
m = m[field].(map[string]interface{})
}
}
m[fields[len(fields)-1]] = value
}
func setNestedSlice(obj map[string]interface{}, value []string, fields ...string) {
m := make([]interface{}, 0, len(value))
for _, v := range value {
m = append(m, v)
}
setNestedField(obj, m, fields...)
}
func setNestedMap(obj map[string]interface{}, value map[string]string, fields ...string) {
m := make(map[string]interface{}, len(value))
for k, v := range value {
m[k] = v
}
setNestedField(obj, m, fields...)
}
func (u *Unstructured) setNestedField(value interface{}, fields ...string) {
if u.Object == nil {
u.Object = make(map[string]interface{})
}
setNestedField(u.Object, value, fields...)
SetNestedField(u.Object, value, fields...)
}
func (u *Unstructured) setNestedSlice(value []string, fields ...string) {
if u.Object == nil {
u.Object = make(map[string]interface{})
}
setNestedSlice(u.Object, value, fields...)
SetNestedStringSlice(u.Object, value, fields...)
}
func (u *Unstructured) setNestedMap(value map[string]string, fields ...string) {
if u.Object == nil {
u.Object = make(map[string]interface{})
}
setNestedMap(u.Object, value, fields...)
}
func extractOwnerReference(src interface{}) metav1.OwnerReference {
v := src.(map[string]interface{})
// though this field is a *bool, but when decoded from JSON, it's
// unmarshalled as bool.
var controllerPtr *bool
controller, ok := (getNestedField(v, "controller")).(bool)
if !ok {
controllerPtr = nil
} else {
controllerCopy := controller
controllerPtr = &controllerCopy
}
var blockOwnerDeletionPtr *bool
blockOwnerDeletion, ok := (getNestedField(v, "blockOwnerDeletion")).(bool)
if !ok {
blockOwnerDeletionPtr = nil
} else {
blockOwnerDeletionCopy := blockOwnerDeletion
blockOwnerDeletionPtr = &blockOwnerDeletionCopy
}
return metav1.OwnerReference{
Kind: getNestedString(v, "kind"),
Name: getNestedString(v, "name"),
APIVersion: getNestedString(v, "apiVersion"),
UID: (types.UID)(getNestedString(v, "uid")),
Controller: controllerPtr,
BlockOwnerDeletion: blockOwnerDeletionPtr,
}
}
func setOwnerReference(src metav1.OwnerReference) map[string]interface{} {
ret := make(map[string]interface{})
setNestedField(ret, src.Kind, "kind")
setNestedField(ret, src.Name, "name")
setNestedField(ret, src.APIVersion, "apiVersion")
setNestedField(ret, string(src.UID), "uid")
// json.Unmarshal() extracts boolean json fields as bool, not as *bool and hence extractOwnerReference()
// expects bool or a missing field, not *bool. So if pointer is nil, fields are omitted from the ret object.
// If pointer is non-nil, they are set to the referenced value.
if src.Controller != nil {
setNestedField(ret, *src.Controller, "controller")
}
if src.BlockOwnerDeletion != nil {
setNestedField(ret, *src.BlockOwnerDeletion, "blockOwnerDeletion")
}
return ret
}
func getOwnerReferences(object map[string]interface{}) ([]map[string]interface{}, error) {
field := getNestedField(object, "metadata", "ownerReferences")
if field == nil {
return nil, fmt.Errorf("cannot find field metadata.ownerReferences in %v", object)
}
ownerReferences, ok := field.([]map[string]interface{})
if ok {
return ownerReferences, nil
}
// TODO: This is hacky...
interfaces, ok := field.([]interface{})
if !ok {
return nil, fmt.Errorf("expect metadata.ownerReferences to be a slice in %#v", object)
}
ownerReferences = make([]map[string]interface{}, 0, len(interfaces))
for i := 0; i < len(interfaces); i++ {
r, ok := interfaces[i].(map[string]interface{})
if !ok {
return nil, fmt.Errorf("expect element metadata.ownerReferences to be a map[string]interface{} in %#v", object)
}
ownerReferences = append(ownerReferences, r)
}
return ownerReferences, nil
SetNestedStringMap(u.Object, value, fields...)
}
func (u *Unstructured) GetOwnerReferences() []metav1.OwnerReference {
original, err := getOwnerReferences(u.Object)
if err != nil {
glog.V(6).Info(err)
field, ok := nestedFieldNoCopy(u.Object, "metadata", "ownerReferences")
if !ok {
return nil
}
original, ok := field.([]interface{})
if !ok {
return nil
}
ret := make([]metav1.OwnerReference, 0, len(original))
for i := 0; i < len(original); i++ {
ret = append(ret, extractOwnerReference(original[i]))
for _, obj := range original {
o, ok := obj.(map[string]interface{})
if !ok {
// expected map[string]interface{}, got something else
return nil
}
ret = append(ret, extractOwnerReference(o))
}
return ret
}
func (u *Unstructured) SetOwnerReferences(references []metav1.OwnerReference) {
var newReferences = make([]map[string]interface{}, 0, len(references))
for i := 0; i < len(references); i++ {
newReferences = append(newReferences, setOwnerReference(references[i]))
newReferences := make([]interface{}, 0, len(references))
for _, reference := range references {
newReferences = append(newReferences, setOwnerReference(reference))
}
u.setNestedField(newReferences, "metadata", "ownerReferences")
}
@ -433,7 +223,11 @@ func (u *Unstructured) SetResourceVersion(version string) {
}
func (u *Unstructured) GetGeneration() int64 {
return getNestedInt64(u.Object, "metadata", "generation")
val, ok := NestedInt64(u.Object, "metadata", "generation")
if !ok {
return 0
}
return val
}
func (u *Unstructured) SetGeneration(generation int64) {
@ -478,7 +272,7 @@ func (u *Unstructured) GetDeletionTimestamp() *metav1.Time {
func (u *Unstructured) SetDeletionTimestamp(timestamp *metav1.Time) {
if timestamp == nil {
u.setNestedField(nil, "metadata", "deletionTimestamp")
RemoveNestedField(u.Object, "metadata", "deletionTimestamp")
return
}
ts, _ := timestamp.MarshalQueryParameter()
@ -486,15 +280,27 @@ func (u *Unstructured) SetDeletionTimestamp(timestamp *metav1.Time) {
}
func (u *Unstructured) GetDeletionGracePeriodSeconds() *int64 {
return getNestedInt64Pointer(u.Object, "metadata", "deletionGracePeriodSeconds")
val, ok := NestedInt64(u.Object, "metadata", "deletionGracePeriodSeconds")
if !ok {
return nil
}
return &val
}
func (u *Unstructured) SetDeletionGracePeriodSeconds(deletionGracePeriodSeconds *int64) {
u.setNestedField(deletionGracePeriodSeconds, "metadata", "deletionGracePeriodSeconds")
if deletionGracePeriodSeconds == nil {
RemoveNestedField(u.Object, "metadata", "deletionGracePeriodSeconds")
return
}
u.setNestedField(*deletionGracePeriodSeconds, "metadata", "deletionGracePeriodSeconds")
}
func (u *Unstructured) GetLabels() map[string]string {
return getNestedMap(u.Object, "metadata", "labels")
m, ok := NestedStringMap(u.Object, "metadata", "labels")
if !ok {
return nil
}
return m
}
func (u *Unstructured) SetLabels(labels map[string]string) {
@ -502,7 +308,11 @@ func (u *Unstructured) SetLabels(labels map[string]string) {
}
func (u *Unstructured) GetAnnotations() map[string]string {
return getNestedMap(u.Object, "metadata", "annotations")
m, ok := NestedStringMap(u.Object, "metadata", "annotations")
if !ok {
return nil
}
return m
}
func (u *Unstructured) SetAnnotations(annotations map[string]string) {
@ -523,15 +333,14 @@ func (u *Unstructured) GroupVersionKind() schema.GroupVersionKind {
return gvk
}
var converter = unstructured.NewConverter(false)
func (u *Unstructured) GetInitializers() *metav1.Initializers {
field := getNestedField(u.Object, "metadata", "initializers")
if field == nil {
field, ok := nestedFieldNoCopy(u.Object, "metadata", "initializers")
if !ok {
return nil
}
obj, ok := field.(map[string]interface{})
if !ok {
// expected map[string]interface{}, got something else
return nil
}
out := &metav1.Initializers{}
@ -542,22 +351,23 @@ func (u *Unstructured) GetInitializers() *metav1.Initializers {
}
func (u *Unstructured) SetInitializers(initializers *metav1.Initializers) {
if u.Object == nil {
u.Object = make(map[string]interface{})
}
if initializers == nil {
setNestedField(u.Object, nil, "metadata", "initializers")
RemoveNestedField(u.Object, "metadata", "initializers")
return
}
out, err := converter.ToUnstructured(initializers)
if err != nil {
utilruntime.HandleError(fmt.Errorf("unable to retrieve initializers for object: %v", err))
}
setNestedField(u.Object, out, "metadata", "initializers")
u.setNestedField(out, "metadata", "initializers")
}
func (u *Unstructured) GetFinalizers() []string {
return getNestedSlice(u.Object, "metadata", "finalizers")
val, ok := NestedStringSlice(u.Object, "metadata", "finalizers")
if !ok {
return nil
}
return val
}
func (u *Unstructured) SetFinalizers(finalizers []string) {
@ -571,272 +381,3 @@ func (u *Unstructured) GetClusterName() string {
func (u *Unstructured) SetClusterName(clusterName string) {
u.setNestedField(clusterName, "metadata", "clusterName")
}
// UnstructuredList allows lists that do not have Golang structs
// registered to be manipulated generically. This can be used to deal
// with the API lists from a plug-in.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen=true
type UnstructuredList struct {
Object map[string]interface{}
// Items is a list of unstructured objects.
Items []Unstructured `json:"items"`
}
var _ metav1.ListInterface = &UnstructuredList{}
// MarshalJSON ensures that the unstructured list object produces proper
// JSON when passed to Go's standard JSON library.
func (u *UnstructuredList) MarshalJSON() ([]byte, error) {
var buf bytes.Buffer
err := UnstructuredJSONScheme.Encode(u, &buf)
return buf.Bytes(), err
}
// UnmarshalJSON ensures that the unstructured list object properly
// decodes JSON when passed to Go's standard JSON library.
func (u *UnstructuredList) UnmarshalJSON(b []byte) error {
_, _, err := UnstructuredJSONScheme.Decode(b, nil, u)
return err
}
func (u *UnstructuredList) setNestedField(value interface{}, fields ...string) {
if u.Object == nil {
u.Object = make(map[string]interface{})
}
setNestedField(u.Object, value, fields...)
}
func (u *UnstructuredList) GetAPIVersion() string {
return getNestedString(u.Object, "apiVersion")
}
func (u *UnstructuredList) SetAPIVersion(version string) {
u.setNestedField(version, "apiVersion")
}
func (u *UnstructuredList) GetKind() string {
return getNestedString(u.Object, "kind")
}
func (u *UnstructuredList) SetKind(kind string) {
u.setNestedField(kind, "kind")
}
func (u *UnstructuredList) GetResourceVersion() string {
return getNestedString(u.Object, "metadata", "resourceVersion")
}
func (u *UnstructuredList) SetResourceVersion(version string) {
u.setNestedField(version, "metadata", "resourceVersion")
}
func (u *UnstructuredList) GetSelfLink() string {
return getNestedString(u.Object, "metadata", "selfLink")
}
func (u *UnstructuredList) SetSelfLink(selfLink string) {
u.setNestedField(selfLink, "metadata", "selfLink")
}
func (u *UnstructuredList) GetContinue() string {
return getNestedString(u.Object, "metadata", "continue")
}
func (u *UnstructuredList) SetContinue(c string) {
u.setNestedField(c, "metadata", "continue")
}
func (u *UnstructuredList) SetGroupVersionKind(gvk schema.GroupVersionKind) {
u.SetAPIVersion(gvk.GroupVersion().String())
u.SetKind(gvk.Kind)
}
func (u *UnstructuredList) GroupVersionKind() schema.GroupVersionKind {
gv, err := schema.ParseGroupVersion(u.GetAPIVersion())
if err != nil {
return schema.GroupVersionKind{}
}
gvk := gv.WithKind(u.GetKind())
return gvk
}
// UnstructuredJSONScheme is capable of converting JSON data into the Unstructured
// type, which can be used for generic access to objects without a predefined scheme.
// TODO: move into serializer/json.
var UnstructuredJSONScheme runtime.Codec = unstructuredJSONScheme{}
type unstructuredJSONScheme struct{}
func (s unstructuredJSONScheme) Decode(data []byte, _ *schema.GroupVersionKind, obj runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
var err error
if obj != nil {
err = s.decodeInto(data, obj)
} else {
obj, err = s.decode(data)
}
if err != nil {
return nil, nil, err
}
gvk := obj.GetObjectKind().GroupVersionKind()
if len(gvk.Kind) == 0 {
return nil, &gvk, runtime.NewMissingKindErr(string(data))
}
return obj, &gvk, nil
}
func (unstructuredJSONScheme) Encode(obj runtime.Object, w io.Writer) error {
switch t := obj.(type) {
case *Unstructured:
return json.NewEncoder(w).Encode(t.Object)
case *UnstructuredList:
items := make([]map[string]interface{}, 0, len(t.Items))
for _, i := range t.Items {
items = append(items, i.Object)
}
listObj := make(map[string]interface{}, len(t.Object)+1)
for k, v := range t.Object { // Make a shallow copy
listObj[k] = v
}
listObj["items"] = items
return json.NewEncoder(w).Encode(listObj)
case *runtime.Unknown:
// TODO: Unstructured needs to deal with ContentType.
_, err := w.Write(t.Raw)
return err
default:
return json.NewEncoder(w).Encode(t)
}
}
func (s unstructuredJSONScheme) decode(data []byte) (runtime.Object, error) {
type detector struct {
Items gojson.RawMessage
}
var det detector
if err := json.Unmarshal(data, &det); err != nil {
return nil, err
}
if det.Items != nil {
list := &UnstructuredList{}
err := s.decodeToList(data, list)
return list, err
}
// No Items field, so it wasn't a list.
unstruct := &Unstructured{}
err := s.decodeToUnstructured(data, unstruct)
return unstruct, err
}
func (s unstructuredJSONScheme) decodeInto(data []byte, obj runtime.Object) error {
switch x := obj.(type) {
case *Unstructured:
return s.decodeToUnstructured(data, x)
case *UnstructuredList:
return s.decodeToList(data, x)
case *runtime.VersionedObjects:
o, err := s.decode(data)
if err == nil {
x.Objects = []runtime.Object{o}
}
return err
default:
return json.Unmarshal(data, x)
}
}
func (unstructuredJSONScheme) decodeToUnstructured(data []byte, unstruct *Unstructured) error {
m := make(map[string]interface{})
if err := json.Unmarshal(data, &m); err != nil {
return err
}
unstruct.Object = m
return nil
}
func (s unstructuredJSONScheme) decodeToList(data []byte, list *UnstructuredList) error {
type decodeList struct {
Items []gojson.RawMessage
}
var dList decodeList
if err := json.Unmarshal(data, &dList); err != nil {
return err
}
if err := json.Unmarshal(data, &list.Object); err != nil {
return err
}
// For typed lists, e.g., a PodList, API server doesn't set each item's
// APIVersion and Kind. We need to set it.
listAPIVersion := list.GetAPIVersion()
listKind := list.GetKind()
itemKind := strings.TrimSuffix(listKind, "List")
delete(list.Object, "items")
list.Items = nil
for _, i := range dList.Items {
unstruct := &Unstructured{}
if err := s.decodeToUnstructured([]byte(i), unstruct); err != nil {
return err
}
// This is hacky. Set the item's Kind and APIVersion to those inferred
// from the List.
if len(unstruct.GetKind()) == 0 && len(unstruct.GetAPIVersion()) == 0 {
unstruct.SetKind(itemKind)
unstruct.SetAPIVersion(listAPIVersion)
}
list.Items = append(list.Items, *unstruct)
}
return nil
}
// UnstructuredObjectConverter is an ObjectConverter for use with
// Unstructured objects. Since it has no schema or type information,
// it will only succeed for no-op conversions. This is provided as a
// sane implementation for APIs that require an object converter.
type UnstructuredObjectConverter struct{}
func (UnstructuredObjectConverter) Convert(in, out, context interface{}) error {
unstructIn, ok := in.(*Unstructured)
if !ok {
return fmt.Errorf("input type %T in not valid for unstructured conversion", in)
}
unstructOut, ok := out.(*Unstructured)
if !ok {
return fmt.Errorf("output type %T in not valid for unstructured conversion", out)
}
// maybe deep copy the map? It is documented in the
// ObjectConverter interface that this function is not
// guaranteeed to not mutate the input. Or maybe set the input
// object to nil.
unstructOut.Object = unstructIn.Object
return nil
}
func (UnstructuredObjectConverter) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) {
if kind := in.GetObjectKind().GroupVersionKind(); !kind.Empty() {
gvk, ok := target.KindForGroupVersionKinds([]schema.GroupVersionKind{kind})
if !ok {
// TODO: should this be a typed error?
return nil, fmt.Errorf("%v is unstructured and is not suitable for converting to %q", kind, target)
}
in.GetObjectKind().SetGroupVersionKind(gvk)
}
return in, nil
}
func (UnstructuredObjectConverter) ConvertFieldLabel(version, kind, label, value string) (string, string, error) {
return "", "", errors.New("unstructured cannot convert field labels")
}

View File

@ -0,0 +1,165 @@
/*
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 unstructured
import (
"bytes"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/conversion/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var _ runtime.Unstructured = &UnstructuredList{}
var _ metav1.ListInterface = &UnstructuredList{}
// UnstructuredList allows lists that do not have Golang structs
// registered to be manipulated generically. This can be used to deal
// with the API lists from a plug-in.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen=true
type UnstructuredList struct {
Object map[string]interface{}
// Items is a list of unstructured objects.
Items []Unstructured `json:"items"`
}
func (u *UnstructuredList) GetObjectKind() schema.ObjectKind { return u }
func (u *UnstructuredList) IsUnstructuredObject() {}
func (u *UnstructuredList) IsList() bool { return true }
func (u *UnstructuredList) EachListItem(fn func(runtime.Object) error) error {
for i := range u.Items {
if err := fn(&u.Items[i]); err != nil {
return err
}
}
return nil
}
// UnstructuredContent returns a map contain an overlay of the Items field onto
// the Object field. Items always overwrites overlay. Changing "items" in the
// returned object will affect items in the underlying Items field, but changing
// the "items" slice itself will have no effect.
// TODO: expose SetUnstructuredContent on runtime.Unstructured that allows
// items to be changed.
func (u *UnstructuredList) UnstructuredContent() map[string]interface{} {
out := u.Object
if out == nil {
out = make(map[string]interface{})
}
items := make([]interface{}, len(u.Items))
for i, item := range u.Items {
items[i] = item.Object
}
out["items"] = items
return out
}
func (u *UnstructuredList) DeepCopy() *UnstructuredList {
if u == nil {
return nil
}
out := new(UnstructuredList)
*out = *u
out.Object = unstructured.DeepCopyJSON(u.Object)
out.Items = make([]Unstructured, len(u.Items))
for i := range u.Items {
u.Items[i].DeepCopyInto(&out.Items[i])
}
return out
}
// MarshalJSON ensures that the unstructured list object produces proper
// JSON when passed to Go's standard JSON library.
func (u *UnstructuredList) MarshalJSON() ([]byte, error) {
var buf bytes.Buffer
err := UnstructuredJSONScheme.Encode(u, &buf)
return buf.Bytes(), err
}
// UnmarshalJSON ensures that the unstructured list object properly
// decodes JSON when passed to Go's standard JSON library.
func (u *UnstructuredList) UnmarshalJSON(b []byte) error {
_, _, err := UnstructuredJSONScheme.Decode(b, nil, u)
return err
}
func (u *UnstructuredList) GetAPIVersion() string {
return getNestedString(u.Object, "apiVersion")
}
func (u *UnstructuredList) SetAPIVersion(version string) {
u.setNestedField(version, "apiVersion")
}
func (u *UnstructuredList) GetKind() string {
return getNestedString(u.Object, "kind")
}
func (u *UnstructuredList) SetKind(kind string) {
u.setNestedField(kind, "kind")
}
func (u *UnstructuredList) GetResourceVersion() string {
return getNestedString(u.Object, "metadata", "resourceVersion")
}
func (u *UnstructuredList) SetResourceVersion(version string) {
u.setNestedField(version, "metadata", "resourceVersion")
}
func (u *UnstructuredList) GetSelfLink() string {
return getNestedString(u.Object, "metadata", "selfLink")
}
func (u *UnstructuredList) SetSelfLink(selfLink string) {
u.setNestedField(selfLink, "metadata", "selfLink")
}
func (u *UnstructuredList) GetContinue() string {
return getNestedString(u.Object, "metadata", "continue")
}
func (u *UnstructuredList) SetContinue(c string) {
u.setNestedField(c, "metadata", "continue")
}
func (u *UnstructuredList) SetGroupVersionKind(gvk schema.GroupVersionKind) {
u.SetAPIVersion(gvk.GroupVersion().String())
u.SetKind(gvk.Kind)
}
func (u *UnstructuredList) GroupVersionKind() schema.GroupVersionKind {
gv, err := schema.ParseGroupVersion(u.GetAPIVersion())
if err != nil {
return schema.GroupVersionKind{}
}
gvk := gv.WithKind(u.GetKind())
return gvk
}
func (u *UnstructuredList) setNestedField(value interface{}, fields ...string) {
if u.Object == nil {
u.Object = make(map[string]interface{})
}
SetNestedField(u.Object, value, fields...)
}

View File

@ -426,21 +426,23 @@ func (c *converterImpl) ToUnstructured(obj interface{}) (map[string]interface{},
// DeepCopyJSON deep copies the passed value, assuming it is a valid JSON representation i.e. only contains
// types produced by json.Unmarshal().
func DeepCopyJSON(x map[string]interface{}) map[string]interface{} {
return deepCopyJSON(x).(map[string]interface{})
return DeepCopyJSONValue(x).(map[string]interface{})
}
func deepCopyJSON(x interface{}) interface{} {
// DeepCopyJSONValue deep copies the passed value, assuming it is a valid JSON representation i.e. only contains
// types produced by json.Unmarshal().
func DeepCopyJSONValue(x interface{}) interface{} {
switch x := x.(type) {
case map[string]interface{}:
clone := make(map[string]interface{}, len(x))
for k, v := range x {
clone[k] = deepCopyJSON(v)
clone[k] = DeepCopyJSONValue(v)
}
return clone
case []interface{}:
clone := make([]interface{}, len(x))
for i, v := range x {
clone[i] = deepCopyJSON(v)
clone[i] = DeepCopyJSONValue(v)
}
return clone
case string, int64, bool, float64, nil, encodingjson.Number:

View File

@ -29,6 +29,7 @@ var (
ErrBadPatchFormatForRetainKeys = errors.New("invalid patch format of retainKeys")
ErrBadPatchFormatForSetElementOrderList = errors.New("invalid patch format of setElementOrder list")
ErrPatchContentNotMatchRetainKeys = errors.New("patch content doesn't match retainKeys list")
ErrUnsupportedStrategicMergePatchFormat = errors.New("strategic merge patch format is not supported")
)
func ErrNoMergeKey(m map[string]interface{}, k string) error {

View File

@ -276,17 +276,7 @@ func NewProxierWithNoProxyCIDR(delegate func(req *http.Request) (*url.URL, error
}
return func(req *http.Request) (*url.URL, error) {
host := req.URL.Host
// for some urls, the Host is already the host, not the host:port
if net.ParseIP(host) == nil {
var err error
host, _, err = net.SplitHostPort(req.URL.Host)
if err != nil {
return delegate(req)
}
}
ip := net.ParseIP(host)
ip := net.ParseIP(req.URL.Hostname())
if ip == nil {
return delegate(req)
}

View File

@ -25,6 +25,7 @@ go_library(
srcs = ["patch.go"],
importpath = "k8s.io/apimachinery/pkg/util/strategicpatch",
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/mergepatch:go_default_library",
"//vendor/k8s.io/apimachinery/third_party/forked/golang/json:go_default_library",

View File

@ -22,6 +22,7 @@ import (
"sort"
"strings"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/util/json"
"k8s.io/apimachinery/pkg/util/mergepatch"
forkedjson "k8s.io/apimachinery/third_party/forked/golang/json"
@ -515,6 +516,9 @@ func normalizeSliceOrder(toSort, order []interface{}, mergeKey string, kind refl
return nil, err
}
toSort, toDelete, err = extractToDeleteItems(toSort)
if err != nil {
return nil, err
}
}
sort.SliceStable(toSort, func(i, j int) bool {
@ -554,7 +558,13 @@ func diffLists(original, modified []interface{}, t reflect.Type, mergeKey string
switch kind {
case reflect.Map:
patchList, deleteList, err = diffListsOfMaps(original, modified, t, mergeKey, diffOptions)
if err != nil {
return nil, nil, nil, err
}
patchList, err = normalizeSliceOrder(patchList, modified, mergeKey, kind)
if err != nil {
return nil, nil, nil, err
}
orderSame, err := isOrderSame(original, modified, mergeKey)
if err != nil {
return nil, nil, nil, err
@ -580,6 +590,9 @@ func diffLists(original, modified []interface{}, t reflect.Type, mergeKey string
return nil, nil, nil, mergepatch.ErrNoListOfLists
default:
patchList, deleteList, err = diffListsOfScalars(original, modified, diffOptions)
if err != nil {
return nil, nil, nil, err
}
patchList, err = normalizeSliceOrder(patchList, modified, mergeKey, kind)
// generate the setElementOrder list when there are content changes or order changes
if diffOptions.SetElementOrder && ((!diffOptions.IgnoreDeletions && len(deleteList) > 0) ||
@ -816,7 +829,7 @@ func handleUnmarshal(j []byte) (map[string]interface{}, error) {
return m, nil
}
// StrategicMergePatch applies a strategic merge patch. The original and patch documents
// StrategicMergeMapPatch applies a strategic merge patch. The original and patch documents
// must be JSONMap. A patch can be created from an original and modified document by
// calling CreateTwoWayMergeMapPatch.
// Warning: the original and patch JSONMap objects are mutated by this function and should not be reused.
@ -825,6 +838,17 @@ func StrategicMergeMapPatch(original, patch JSONMap, dataStruct interface{}) (JS
if err != nil {
return nil, err
}
// We need the go struct tags `patchMergeKey` and `patchStrategy` for fields that support a strategic merge patch.
// For native resources, we can easily figure out these tags since we know the fields.
// Because custom resources are decoded as Unstructured and because we're missing the metadata about how to handle
// each field in a strategic merge patch, we can't find the go struct tags. Hence, we can't easily do a strategic merge
// for custom resources. So we should fail fast and return an error.
if _, ok := dataStruct.(*unstructured.Unstructured); ok {
return nil, mergepatch.ErrUnsupportedStrategicMergePatchFormat
}
mergeOptions := MergeOptions{
MergeParallelList: true,
IgnoreUnmatchedNulls: true,
@ -1520,7 +1544,7 @@ func findMapInSliceBasedOnKeyValue(m []interface{}, key string, value interface{
for k, v := range m {
typedV, ok := v.(map[string]interface{})
if !ok {
return nil, 0, false, fmt.Errorf("value for key %v is not a map.", k)
return nil, 0, false, fmt.Errorf("value for key %v is not a map", k)
}
valueToMatch, ok := typedV[key]
@ -1540,7 +1564,7 @@ func sortMergeListsByName(mapJSON []byte, dataStruct interface{}) ([]byte, error
var m map[string]interface{}
err := json.Unmarshal(mapJSON, &m)
if err != nil {
return nil, err
return nil, mergepatch.ErrBadJSONDoc
}
newM, err := sortMergeListsByNameMap(m, reflect.TypeOf(dataStruct))

1
vendor/k8s.io/client-go/rest/BUILD generated vendored
View File

@ -19,6 +19,7 @@ go_test(
importpath = "k8s.io/client-go/rest",
library = ":go_default_library",
deps = [
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/google/gofuzz:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",

View File

@ -827,6 +827,8 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu
func truncateBody(body string) string {
max := 0
switch {
case bool(glog.V(10)):
return body
case bool(glog.V(9)):
max = 10240
case bool(glog.V(8)):

View File

@ -109,7 +109,7 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{},
r := &Reflector{
name: name,
// we need this to be unique per process (some names are still the same)but obvious who it belongs to
metrics: newReflectorMetrics(makeValidPromethusMetricName(fmt.Sprintf("reflector_"+name+"_%d", reflectorSuffix))),
metrics: newReflectorMetrics(makeValidPromethusMetricLabel(fmt.Sprintf("reflector_"+name+"_%d", reflectorSuffix))),
listerWatcher: lw,
store: store,
expectedType: reflect.TypeOf(expectedType),
@ -120,9 +120,9 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{},
return r
}
func makeValidPromethusMetricName(in string) string {
func makeValidPromethusMetricLabel(in string) string {
// this isn't perfect, but it removes our common characters
return strings.NewReplacer("/", "_", ".", "_", "-", "_").Replace(in)
return strings.NewReplacer("/", "_", ".", "_", "-", "_", ":", "_").Replace(in)
}
// internalPackages are packages that ignored when creating a default reflector name. These packages are in the common