diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a2e51fe63..6d09f6d14 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -6,6 +6,11 @@ "./..." ], "Deps": [ + { + "ImportPath": "github.com/Sirupsen/logrus", + "Comment": "v0.6.2-10-g51fe59a", + "Rev": "51fe59aca108dc5680109e7b2051cbdcfa5a253c" + }, { "ImportPath": "github.com/beorn7/perks/quantile", "Rev": "3ac7bf7a47d159a033b107610db8a1b6575507a4" @@ -74,11 +79,6 @@ "Comment": "v2.4.0-rc.1-38-gcd27f17", "Rev": "cd27f179f2c10c5d300e6d09025b538c475b0d51" }, - { - "ImportPath": "github.com/docker/docker/pkg/mount", - "Comment": "v1.4.1-4831-g0f5c9d3", - "Rev": "0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d" - }, { "ImportPath": "github.com/docker/engine-api/types", "Comment": "v0.3.1-62-g3d72d39", @@ -131,18 +131,18 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Comment": "v1.2-54-g7c47e25", - "Rev": "7c47e2558a0bbbaba9ecab06bc6681e73028a28a" + "Comment": "v1.2-66-gc4afa8e", + "Rev": "c4afa8e5421428d584b32d36d7b35f2c9ae5f823" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Comment": "v1.2-54-g7c47e25", - "Rev": "7c47e2558a0bbbaba9ecab06bc6681e73028a28a" + "Comment": "v1.2-66-gc4afa8e", + "Rev": "c4afa8e5421428d584b32d36d7b35f2c9ae5f823" }, { "ImportPath": "github.com/emicklei/go-restful/swagger", - "Comment": "v1.2-54-g7c47e25", - "Rev": "7c47e2558a0bbbaba9ecab06bc6681e73028a28a" + "Comment": "v1.2-66-gc4afa8e", + "Rev": "c4afa8e5421428d584b32d36d7b35f2c9ae5f823" }, { "ImportPath": "github.com/evanphx/json-patch", @@ -175,8 +175,8 @@ }, { "ImportPath": "github.com/google/cadvisor/info/v1", - "Comment": "v0.23.4", - "Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e" + "Comment": "v0.23.2-25-g51574ec", + "Rev": "51574ec04ff12ca5a50f0935625ec02437191a06" }, { "ImportPath": "github.com/google/gofuzz", @@ -209,23 +209,28 @@ }, { "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups", - "Comment": "v0.0.7", - "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + "Comment": "v1.0.0-rc1-57-g4eb8c2f", + "Rev": "4eb8c2fb1dcb10fa3bf9bd7031f3a25a8ce2fef6" }, { "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups/fs", - "Comment": "v0.0.7", - "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + "Comment": "v1.0.0-rc1-57-g4eb8c2f", + "Rev": "4eb8c2fb1dcb10fa3bf9bd7031f3a25a8ce2fef6" }, { "ImportPath": "github.com/opencontainers/runc/libcontainer/configs", - "Comment": "v0.0.7", - "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + "Comment": "v1.0.0-rc1-57-g4eb8c2f", + "Rev": "4eb8c2fb1dcb10fa3bf9bd7031f3a25a8ce2fef6" }, { "ImportPath": "github.com/opencontainers/runc/libcontainer/system", - "Comment": "v0.0.7", - "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + "Comment": "v1.0.0-rc1-57-g4eb8c2f", + "Rev": "4eb8c2fb1dcb10fa3bf9bd7031f3a25a8ce2fef6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/utils", + "Comment": "v1.0.0-rc1-57-g4eb8c2f", + "Rev": "4eb8c2fb1dcb10fa3bf9bd7031f3a25a8ce2fef6" }, { "ImportPath": "github.com/pborman/uuid", @@ -360,718 +365,738 @@ }, { "ImportPath": "k8s.io/kubernetes/federation/apis/federation", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/federation/apis/federation/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { - "ImportPath": "k8s.io/kubernetes/federation/apis/federation/v1alpha1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "ImportPath": "k8s.io/kubernetes/federation/apis/federation/v1beta1", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/annotations", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/endpoints", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/errors", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/meta", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/meta/metatypes", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/pod", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/resource", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/rest", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/service", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/testapi", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/unversioned/validation", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/util", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/v1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/api/validation", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apimachinery", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apimachinery/registered", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/apps", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/apps/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/apps/v1alpha1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/authentication.k8s.io", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/authorization", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/authorization/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/authorization/v1beta1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/autoscaling", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/autoscaling/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/autoscaling/v1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/batch", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/batch/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/batch/v1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/batch/v2alpha1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/apis/certificates", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/apis/certificates/install", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/apis/certificates/v1alpha1", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/componentconfig", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/componentconfig/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/extensions", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/extensions/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/extensions/v1beta1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/extensions/validation", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/policy", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/policy/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/policy/v1alpha1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/rbac", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/rbac/install", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/auth/user", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/capabilities", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/cache", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/metrics", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/record", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/restclient", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/transport", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/typed/discovery", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned/adapters/internalclientset", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned/auth", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned/clientcmd", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/latest", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned/testclient", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/cloudprovider", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/cloudprovider/providers/gce", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/controller", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/controller/deployment/util", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/controller/framework", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/conversion", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/conversion/queryparams", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/credentialprovider", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/fieldpath", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/fields", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/healthz", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/kubectl", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/kubectl/cmd/util", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/kubectl/resource", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/kubelet/qos", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" - }, - { - "ImportPath": "k8s.io/kubernetes/pkg/kubelet/qos/util", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/labels", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/master/ports", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/generic", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime/serializer", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime/serializer/json", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime/serializer/protobuf", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime/serializer/recognizer", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime/serializer/streaming", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime/serializer/versioning", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/security/podsecuritypolicy/util", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/storage", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/types", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/crypto", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" - }, - { - "ImportPath": "k8s.io/kubernetes/pkg/util/deployment", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/errors", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/flag", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/flowcontrol", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/framer", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/hash", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/homedir", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/integer", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/intstr", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/json", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/jsonpath", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/labels", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/net", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/net/sets", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/parsers", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/pod", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/rand", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/replicaset", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/runtime", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/sets", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/slice", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/strategicpatch", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/util/sysctl", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/validation", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/validation/field", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/wait", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/workqueue", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/util/yaml", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/version", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/watch", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/pkg/watch/versioned", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/client/auth", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/client/auth/gcp", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/client/auth/oidc", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { - "ImportPath": "k8s.io/kubernetes/third_party/forked/json", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "ImportPath": "k8s.io/kubernetes/third_party/forked/golang/json", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { - "ImportPath": "k8s.io/kubernetes/third_party/forked/reflect", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "ImportPath": "k8s.io/kubernetes/third_party/forked/golang/reflect", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" }, { - "ImportPath": "k8s.io/kubernetes/third_party/golang/template", - "Comment": "v1.4.0-alpha.0-530-g482a7be", - "Rev": "482a7bee2f70f97f28ba1abb525228217a2cef23" + "ImportPath": "k8s.io/kubernetes/third_party/forked/golang/template", + "Comment": "v1.4.0-alpha.1-42-gb840f03", + "Rev": "b840f039cce0e142f8ba014ec0722a19e58bfc2d" } ] } diff --git a/controllers/gce/controller/controller.go b/controllers/gce/controller/controller.go index 82143ac80..14f705c23 100644 --- a/controllers/gce/controller/controller.go +++ b/controllers/gce/controller/controller.go @@ -439,20 +439,22 @@ func (lbc *LoadBalancerController) syncNodes(key string) error { return nil } -func nodeReady(node api.Node) bool { - for ix := range node.Status.Conditions { - condition := &node.Status.Conditions[ix] - if condition.Type == api.NodeReady { - return condition.Status == api.ConditionTrue +func getNodeReadyPredicate() cache.NodeConditionPredicate { + return func(node *api.Node) bool { + for ix := range node.Status.Conditions { + condition := &node.Status.Conditions[ix] + if condition.Type == api.NodeReady { + return condition.Status == api.ConditionTrue + } } + return false } - return false } // getReadyNodeNames returns names of schedulable, ready nodes from the node lister. func (lbc *LoadBalancerController) getReadyNodeNames() ([]string, error) { nodeNames := []string{} - nodes, err := lbc.nodeLister.NodeCondition(nodeReady).List() + nodes, err := lbc.nodeLister.NodeCondition(getNodeReadyPredicate()).List() if err != nil { return nodeNames, err } diff --git a/controllers/gce/controller/utils.go b/controllers/gce/controller/utils.go index 1d9cdc092..298c17978 100644 --- a/controllers/gce/controller/utils.go +++ b/controllers/gce/controller/utils.go @@ -365,7 +365,7 @@ func getZone(n api.Node) string { // GetZoneForNode returns the zone for a given node by looking up its zone label. func (t *GCETranslator) GetZoneForNode(name string) (string, error) { - nodes, err := t.nodeLister.NodeCondition(nodeReady).List() + nodes, err := t.nodeLister.NodeCondition(getNodeReadyPredicate()).List() if err != nil { return "", err } @@ -382,7 +382,7 @@ func (t *GCETranslator) GetZoneForNode(name string) (string, error) { // ListZones returns a list of zones this Kubernetes cluster spans. func (t *GCETranslator) ListZones() ([]string, error) { zones := sets.String{} - readyNodes, err := t.nodeLister.NodeCondition(nodeReady).List() + readyNodes, err := t.nodeLister.NodeCondition(getNodeReadyPredicate()).List() if err != nil { return zones.List(), err } diff --git a/controllers/nginx/nginx.tmpl b/controllers/nginx/nginx.tmpl index 1f178a636..e72eb4f6f 100644 --- a/controllers/nginx/nginx.tmpl +++ b/controllers/nginx/nginx.tmpl @@ -276,7 +276,7 @@ http { # default server, including healthcheck server { - listen 8080 default_server reuseport; + listen 8080 default_server reuseport backlog={{ .backlogSize }}; location /healthz { access_log off; diff --git a/controllers/nginx/nginx/template.go b/controllers/nginx/nginx/template.go index b12641efa..1b131c7fb 100644 --- a/controllers/nginx/nginx/template.go +++ b/controllers/nginx/nginx/template.go @@ -61,6 +61,7 @@ func (ngx *Manager) loadTemplate() { func (ngx *Manager) writeCfg(cfg config.Configuration, ingressCfg IngressConfig) (bool, error) { conf := make(map[string]interface{}) + conf["backlogSize"] = sysctlSomaxconn() conf["upstreams"] = ingressCfg.Upstreams conf["servers"] = ingressCfg.Servers conf["tcpUpstreams"] = ingressCfg.TCPUpstreams diff --git a/controllers/nginx/nginx/utils.go b/controllers/nginx/nginx/utils.go index 906642914..15970ea51 100644 --- a/controllers/nginx/nginx/utils.go +++ b/controllers/nginx/nginx/utils.go @@ -28,6 +28,7 @@ import ( "github.com/golang/glog" "github.com/mitchellh/mapstructure" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/util/sysctl" "k8s.io/contrib/ingress/controllers/nginx/nginx/config" ) @@ -220,3 +221,16 @@ func diff(b1, b2 []byte) (data []byte, err error) { } return } + +// sysctlSomaxconn returns the value of net.core.somaxconn, i.e. +// maximum number of connections that can be queued for acceptance +// http://nginx.org/en/docs/http/ngx_http_core_module.html#listen +func sysctlSomaxconn() int { + maxConns, err := sysctl.GetSysctl("net.core.somaxconn") + if err != nil || maxConns < 512 { + glog.Warningf("system net.core.somaxconn=%v. Using NGINX default (511)", maxConns) + return 511 + } + + return maxConns +} diff --git a/vendor/github.com/Sirupsen/logrus/.gitignore b/vendor/github.com/Sirupsen/logrus/.gitignore new file mode 100644 index 000000000..66be63a00 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/.gitignore @@ -0,0 +1 @@ +logrus diff --git a/vendor/github.com/Sirupsen/logrus/.travis.yml b/vendor/github.com/Sirupsen/logrus/.travis.yml new file mode 100644 index 000000000..c3af3ce27 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/.travis.yml @@ -0,0 +1,10 @@ +language: go +go: + - 1.2 + - 1.3 + - tip +install: + - go get github.com/stretchr/testify + - go get github.com/stvp/go-udp-testing + - go get github.com/tobi/airbrake-go + - go get github.com/getsentry/raven-go diff --git a/vendor/github.com/Sirupsen/logrus/LICENSE b/vendor/github.com/Sirupsen/logrus/LICENSE new file mode 100644 index 000000000..f090cb42f --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Simon Eskildsen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/Sirupsen/logrus/README.md b/vendor/github.com/Sirupsen/logrus/README.md new file mode 100644 index 000000000..b6aa84c98 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/README.md @@ -0,0 +1,352 @@ +# Logrus :walrus: [![Build Status](https://travis-ci.org/Sirupsen/logrus.svg?branch=master)](https://travis-ci.org/Sirupsen/logrus) + +Logrus is a structured logger for Go (golang), completely API compatible with +the standard library logger. [Godoc][godoc]. **Please note the Logrus API is not +yet stable (pre 1.0), the core API is unlikely change much but please version +control your Logrus to make sure you aren't fetching latest `master` on every +build.** + +Nicely color-coded in development (when a TTY is attached, otherwise just +plain text): + +![Colored](http://i.imgur.com/PY7qMwd.png) + +With `log.Formatter = new(logrus.JSONFormatter)`, for easy parsing by logstash +or Splunk: + +```json +{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the +ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} + +{"level":"warning","msg":"The group's number increased tremendously!", +"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} + +{"animal":"walrus","level":"info","msg":"A giant walrus appears!", +"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} + +{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", +"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} + +{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, +"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} +``` + +With the default `log.Formatter = new(logrus.TextFormatter)` when a TTY is not +attached, the output is compatible with the +[l2met](http://r.32k.io/l2met-introduction) format: + +```text +time="2014-04-20 15:36:23.830442383 -0400 EDT" level="info" msg="A group of walrus emerges from the ocean" animal="walrus" size=10 +time="2014-04-20 15:36:23.830584199 -0400 EDT" level="warning" msg="The group's number increased tremendously!" omg=true number=122 +time="2014-04-20 15:36:23.830596521 -0400 EDT" level="info" msg="A giant walrus appears!" animal="walrus" size=10 +time="2014-04-20 15:36:23.830611837 -0400 EDT" level="info" msg="Tremendously sized cow enters the ocean." animal="walrus" size=9 +time="2014-04-20 15:36:23.830626464 -0400 EDT" level="fatal" msg="The ice breaks!" omg=true number=100 +``` + +#### Example + +The simplest way to use Logrus is simply the package-level exported logger: + +```go +package main + +import ( + log "github.com/Sirupsen/logrus" +) + +func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + }).Info("A walrus appears") +} +``` + +Note that it's completely api-compatible with the stdlib logger, so you can +replace your `log` imports everywhere with `log "github.com/Sirupsen/logrus"` +and you'll now have the flexibility of Logrus. You can customize it all you +want: + +```go +package main + +import ( + "os" + log "github.com/Sirupsen/logrus" + "github.com/Sirupsen/logrus/hooks/airbrake" +) + +func init() { + // Log as JSON instead of the default ASCII formatter. + log.SetFormatter(&log.JSONFormatter{}) + + // Use the Airbrake hook to report errors that have Error severity or above to + // an exception tracker. You can create custom hooks, see the Hooks section. + log.AddHook(&logrus_airbrake.AirbrakeHook{}) + + // Output to stderr instead of stdout, could also be a file. + log.SetOutput(os.Stderr) + + // Only log the warning severity or above. + log.SetLevel(log.WarnLevel) +} + +func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + "size": 10, + }).Info("A group of walrus emerges from the ocean") + + log.WithFields(log.Fields{ + "omg": true, + "number": 122, + }).Warn("The group's number increased tremendously!") + + log.WithFields(log.Fields{ + "omg": true, + "number": 100, + }).Fatal("The ice breaks!") +} +``` + +For more advanced usage such as logging to multiple locations from the same +application, you can also create an instance of the `logrus` Logger: + +```go +package main + +import ( + "github.com/Sirupsen/logrus" +) + +// Create a new instance of the logger. You can have any number of instances. +var log = logrus.New() + +func main() { + // The API for setting attributes is a little different than the package level + // exported logger. See Godoc. + log.Out = os.Stderr + + log.WithFields(logrus.Fields{ + "animal": "walrus", + "size": 10, + }).Info("A group of walrus emerges from the ocean") +} +``` + +#### Fields + +Logrus encourages careful, structured logging though logging fields instead of +long, unparseable error messages. For example, instead of: `log.Fatalf("Failed +to send event %s to topic %s with key %d")`, you should log the much more +discoverable: + +```go +log.WithFields(log.Fields{ + "event": event, + "topic": topic, + "key": key, +}).Fatal("Failed to send event") +``` + +We've found this API forces you to think about logging in a way that produces +much more useful logging messages. We've been in countless situations where just +a single added field to a log statement that was already there would've saved us +hours. The `WithFields` call is optional. + +In general, with Logrus using any of the `printf`-family functions should be +seen as a hint you should add a field, however, you can still use the +`printf`-family functions with Logrus. + +#### Hooks + +You can add hooks for logging levels. For example to send errors to an exception +tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to +multiple places simultaneously, e.g. syslog. + +```go +// Not the real implementation of the Airbrake hook. Just a simple sample. +import ( + log "github.com/Sirupsen/logrus" +) + +func init() { + log.AddHook(new(AirbrakeHook)) +} + +type AirbrakeHook struct{} + +// `Fire()` takes the entry that the hook is fired for. `entry.Data[]` contains +// the fields for the entry. See the Fields section of the README. +func (hook *AirbrakeHook) Fire(entry *logrus.Entry) error { + err := airbrake.Notify(entry.Data["error"].(error)) + if err != nil { + log.WithFields(log.Fields{ + "source": "airbrake", + "endpoint": airbrake.Endpoint, + }).Info("Failed to send error to Airbrake") + } + + return nil +} + +// `Levels()` returns a slice of `Levels` the hook is fired for. +func (hook *AirbrakeHook) Levels() []log.Level { + return []log.Level{ + log.ErrorLevel, + log.FatalLevel, + log.PanicLevel, + } +} +``` + +Logrus comes with built-in hooks. Add those, or your custom hook, in `init`: + +```go +import ( + log "github.com/Sirupsen/logrus" + "github.com/Sirupsen/logrus/hooks/airbrake" + "github.com/Sirupsen/logrus/hooks/syslog" + "log/syslog" +) + +func init() { + log.AddHook(new(logrus_airbrake.AirbrakeHook)) + + hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") + if err != nil { + log.Error("Unable to connect to local syslog daemon") + } else { + log.AddHook(hook) + } +} +``` + +* [`github.com/Sirupsen/logrus/hooks/airbrake`](https://github.com/Sirupsen/logrus/blob/master/hooks/airbrake/airbrake.go) + Send errors to an exception tracking service compatible with the Airbrake API. + Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. + +* [`github.com/Sirupsen/logrus/hooks/papertrail`](https://github.com/Sirupsen/logrus/blob/master/hooks/papertrail/papertrail.go) + Send errors to the Papertrail hosted logging service via UDP. + +* [`github.com/Sirupsen/logrus/hooks/syslog`](https://github.com/Sirupsen/logrus/blob/master/hooks/syslog/syslog.go) + Send errors to remote syslog server. + Uses standard library `log/syslog` behind the scenes. + +* [`github.com/nubo/hiprus`](https://github.com/nubo/hiprus) + Send errors to a channel in hipchat. + +* [`github.com/sebest/logrusly`](https://github.com/sebest/logrusly) + Send logs to Loggly (https://www.loggly.com/) + +#### Level logging + +Logrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic. + +```go +log.Debug("Useful debugging information.") +log.Info("Something noteworthy happened!") +log.Warn("You should probably take a look at this.") +log.Error("Something failed but I'm not quitting.") +// Calls os.Exit(1) after logging +log.Fatal("Bye.") +// Calls panic() after logging +log.Panic("I'm bailing.") +``` + +You can set the logging level on a `Logger`, then it will only log entries with +that severity or anything above it: + +```go +// Will log anything that is info or above (warn, error, fatal, panic). Default. +log.SetLevel(log.InfoLevel) +``` + +It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose +environment if your application has that. + +#### Entries + +Besides the fields added with `WithField` or `WithFields` some fields are +automatically added to all logging events: + +1. `time`. The timestamp when the entry was created. +2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after + the `AddFields` call. E.g. `Failed to send event.` +3. `level`. The logging level. E.g. `info`. + +#### Environments + +Logrus has no notion of environment. + +If you wish for hooks and formatters to only be used in specific environments, +you should handle that yourself. For example, if your application has a global +variable `Environment`, which is a string representation of the environment you +could do: + +```go +import ( + log "github.com/Sirupsen/logrus" +) + +init() { + // do something here to set environment depending on an environment variable + // or command-line flag + if Environment == "production" { + log.SetFormatter(logrus.JSONFormatter) + } else { + // The TextFormatter is default, you don't actually have to do this. + log.SetFormatter(logrus.TextFormatter) + } +} +``` + +This configuration is how `logrus` was intended to be used, but JSON in +production is mostly only useful if you do log aggregation with tools like +Splunk or Logstash. + +#### Formatters + +The built-in logging formatters are: + +* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise + without colors. + * *Note:* to force colored output when there is no TTY, set the `ForceColors` + field to `true`. To force no colored output even if there is a TTY set the + `DisableColors` field to `true` +* `logrus.JSONFormatter`. Logs fields as JSON. + +Third party logging formatters: + +* [`zalgo`](https://github.com/aybabtme/logzalgo): invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. + +You can define your formatter by implementing the `Formatter` interface, +requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a +`Fields` type (`map[string]interface{}`) with all your fields as well as the +default ones (see Entries section above): + +```go +type MyJSONFormatter struct { +} + +log.SetFormatter(new(MyJSONFormatter)) + +func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { + // Note this doesn't include Time, Level and Message which are available on + // the Entry. Consult `godoc` on information about those fields or read the + // source of the official loggers. + serialized, err := json.Marshal(entry.Data) + if err != nil { + return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) + } + return append(serialized, '\n'), nil +} +``` + +#### Rotation + +Log rotation is not provided with Logrus. Log rotation should be done by an +external program (like `logrotated(8)`) that can compress and delete old log +entries. It should not be a feature of the application-level logger. + + +[godoc]: https://godoc.org/github.com/Sirupsen/logrus diff --git a/vendor/github.com/Sirupsen/logrus/entry.go b/vendor/github.com/Sirupsen/logrus/entry.go new file mode 100644 index 000000000..e164eecb5 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/entry.go @@ -0,0 +1,248 @@ +package logrus + +import ( + "bytes" + "fmt" + "io" + "os" + "time" +) + +// An entry is the final or intermediate Logrus logging entry. It contains all +// the fields passed with WithField{,s}. It's finally logged when Debug, Info, +// Warn, Error, Fatal or Panic is called on it. These objects can be reused and +// passed around as much as you wish to avoid field duplication. +type Entry struct { + Logger *Logger + + // Contains all the fields set by the user. + Data Fields + + // Time at which the log entry was created + Time time.Time + + // Level the log entry was logged at: Debug, Info, Warn, Error, Fatal or Panic + Level Level + + // Message passed to Debug, Info, Warn, Error, Fatal or Panic + Message string +} + +func NewEntry(logger *Logger) *Entry { + return &Entry{ + Logger: logger, + // Default is three fields, give a little extra room + Data: make(Fields, 5), + } +} + +// Returns a reader for the entry, which is a proxy to the formatter. +func (entry *Entry) Reader() (*bytes.Buffer, error) { + serialized, err := entry.Logger.Formatter.Format(entry) + return bytes.NewBuffer(serialized), err +} + +// Returns the string representation from the reader and ultimately the +// formatter. +func (entry *Entry) String() (string, error) { + reader, err := entry.Reader() + if err != nil { + return "", err + } + + return reader.String(), err +} + +// Add a single field to the Entry. +func (entry *Entry) WithField(key string, value interface{}) *Entry { + return entry.WithFields(Fields{key: value}) +} + +// Add a map of fields to the Entry. +func (entry *Entry) WithFields(fields Fields) *Entry { + data := Fields{} + for k, v := range entry.Data { + data[k] = v + } + for k, v := range fields { + data[k] = v + } + return &Entry{Logger: entry.Logger, Data: data} +} + +func (entry *Entry) log(level Level, msg string) { + entry.Time = time.Now() + entry.Level = level + entry.Message = msg + + if err := entry.Logger.Hooks.Fire(level, entry); err != nil { + entry.Logger.mu.Lock() + fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) + entry.Logger.mu.Unlock() + } + + reader, err := entry.Reader() + if err != nil { + entry.Logger.mu.Lock() + fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) + entry.Logger.mu.Unlock() + } + + entry.Logger.mu.Lock() + defer entry.Logger.mu.Unlock() + + _, err = io.Copy(entry.Logger.Out, reader) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) + } + + // To avoid Entry#log() returning a value that only would make sense for + // panic() to use in Entry#Panic(), we avoid the allocation by checking + // directly here. + if level <= PanicLevel { + panic(entry) + } +} + +func (entry *Entry) Debug(args ...interface{}) { + if entry.Logger.Level >= DebugLevel { + entry.log(DebugLevel, fmt.Sprint(args...)) + } +} + +func (entry *Entry) Print(args ...interface{}) { + entry.Info(args...) +} + +func (entry *Entry) Info(args ...interface{}) { + if entry.Logger.Level >= InfoLevel { + entry.log(InfoLevel, fmt.Sprint(args...)) + } +} + +func (entry *Entry) Warn(args ...interface{}) { + if entry.Logger.Level >= WarnLevel { + entry.log(WarnLevel, fmt.Sprint(args...)) + } +} + +func (entry *Entry) Error(args ...interface{}) { + if entry.Logger.Level >= ErrorLevel { + entry.log(ErrorLevel, fmt.Sprint(args...)) + } +} + +func (entry *Entry) Fatal(args ...interface{}) { + if entry.Logger.Level >= FatalLevel { + entry.log(FatalLevel, fmt.Sprint(args...)) + } + os.Exit(1) +} + +func (entry *Entry) Panic(args ...interface{}) { + if entry.Logger.Level >= PanicLevel { + entry.log(PanicLevel, fmt.Sprint(args...)) + } + panic(fmt.Sprint(args...)) +} + +// Entry Printf family functions + +func (entry *Entry) Debugf(format string, args ...interface{}) { + if entry.Logger.Level >= DebugLevel { + entry.Debug(fmt.Sprintf(format, args...)) + } +} + +func (entry *Entry) Infof(format string, args ...interface{}) { + if entry.Logger.Level >= InfoLevel { + entry.Info(fmt.Sprintf(format, args...)) + } +} + +func (entry *Entry) Printf(format string, args ...interface{}) { + entry.Infof(format, args...) +} + +func (entry *Entry) Warnf(format string, args ...interface{}) { + if entry.Logger.Level >= WarnLevel { + entry.Warn(fmt.Sprintf(format, args...)) + } +} + +func (entry *Entry) Warningf(format string, args ...interface{}) { + entry.Warnf(format, args...) +} + +func (entry *Entry) Errorf(format string, args ...interface{}) { + if entry.Logger.Level >= ErrorLevel { + entry.Error(fmt.Sprintf(format, args...)) + } +} + +func (entry *Entry) Fatalf(format string, args ...interface{}) { + if entry.Logger.Level >= FatalLevel { + entry.Fatal(fmt.Sprintf(format, args...)) + } +} + +func (entry *Entry) Panicf(format string, args ...interface{}) { + if entry.Logger.Level >= PanicLevel { + entry.Panic(fmt.Sprintf(format, args...)) + } +} + +// Entry Println family functions + +func (entry *Entry) Debugln(args ...interface{}) { + if entry.Logger.Level >= DebugLevel { + entry.Debug(entry.sprintlnn(args...)) + } +} + +func (entry *Entry) Infoln(args ...interface{}) { + if entry.Logger.Level >= InfoLevel { + entry.Info(entry.sprintlnn(args...)) + } +} + +func (entry *Entry) Println(args ...interface{}) { + entry.Infoln(args...) +} + +func (entry *Entry) Warnln(args ...interface{}) { + if entry.Logger.Level >= WarnLevel { + entry.Warn(entry.sprintlnn(args...)) + } +} + +func (entry *Entry) Warningln(args ...interface{}) { + entry.Warnln(args...) +} + +func (entry *Entry) Errorln(args ...interface{}) { + if entry.Logger.Level >= ErrorLevel { + entry.Error(entry.sprintlnn(args...)) + } +} + +func (entry *Entry) Fatalln(args ...interface{}) { + if entry.Logger.Level >= FatalLevel { + entry.Fatal(entry.sprintlnn(args...)) + } +} + +func (entry *Entry) Panicln(args ...interface{}) { + if entry.Logger.Level >= PanicLevel { + entry.Panic(entry.sprintlnn(args...)) + } +} + +// Sprintlnn => Sprint no newline. This is to get the behavior of how +// fmt.Sprintln where spaces are always added between operands, regardless of +// their type. Instead of vendoring the Sprintln implementation to spare a +// string allocation, we do the simplest thing. +func (entry *Entry) sprintlnn(args ...interface{}) string { + msg := fmt.Sprintln(args...) + return msg[:len(msg)-1] +} diff --git a/vendor/github.com/Sirupsen/logrus/exported.go b/vendor/github.com/Sirupsen/logrus/exported.go new file mode 100644 index 000000000..d08712448 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/exported.go @@ -0,0 +1,182 @@ +package logrus + +import ( + "io" +) + +var ( + // std is the name of the standard logger in stdlib `log` + std = New() +) + +// SetOutput sets the standard logger output. +func SetOutput(out io.Writer) { + std.mu.Lock() + defer std.mu.Unlock() + std.Out = out +} + +// SetFormatter sets the standard logger formatter. +func SetFormatter(formatter Formatter) { + std.mu.Lock() + defer std.mu.Unlock() + std.Formatter = formatter +} + +// SetLevel sets the standard logger level. +func SetLevel(level Level) { + std.mu.Lock() + defer std.mu.Unlock() + std.Level = level +} + +// GetLevel returns the standard logger level. +func GetLevel() Level { + return std.Level +} + +// AddHook adds a hook to the standard logger hooks. +func AddHook(hook Hook) { + std.mu.Lock() + defer std.mu.Unlock() + std.Hooks.Add(hook) +} + +// WithField creates an entry from the standard logger and adds a field to +// it. If you want multiple fields, use `WithFields`. +// +// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal +// or Panic on the Entry it returns. +func WithField(key string, value interface{}) *Entry { + return std.WithField(key, value) +} + +// WithFields creates an entry from the standard logger and adds multiple +// fields to it. This is simply a helper for `WithField`, invoking it +// once for each field. +// +// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal +// or Panic on the Entry it returns. +func WithFields(fields Fields) *Entry { + return std.WithFields(fields) +} + +// Debug logs a message at level Debug on the standard logger. +func Debug(args ...interface{}) { + std.Debug(args...) +} + +// Print logs a message at level Info on the standard logger. +func Print(args ...interface{}) { + std.Print(args...) +} + +// Info logs a message at level Info on the standard logger. +func Info(args ...interface{}) { + std.Info(args...) +} + +// Warn logs a message at level Warn on the standard logger. +func Warn(args ...interface{}) { + std.Warn(args...) +} + +// Warning logs a message at level Warn on the standard logger. +func Warning(args ...interface{}) { + std.Warning(args...) +} + +// Error logs a message at level Error on the standard logger. +func Error(args ...interface{}) { + std.Error(args...) +} + +// Panic logs a message at level Panic on the standard logger. +func Panic(args ...interface{}) { + std.Panic(args...) +} + +// Fatal logs a message at level Fatal on the standard logger. +func Fatal(args ...interface{}) { + std.Fatal(args...) +} + +// Debugf logs a message at level Debug on the standard logger. +func Debugf(format string, args ...interface{}) { + std.Debugf(format, args...) +} + +// Printf logs a message at level Info on the standard logger. +func Printf(format string, args ...interface{}) { + std.Printf(format, args...) +} + +// Infof logs a message at level Info on the standard logger. +func Infof(format string, args ...interface{}) { + std.Infof(format, args...) +} + +// Warnf logs a message at level Warn on the standard logger. +func Warnf(format string, args ...interface{}) { + std.Warnf(format, args...) +} + +// Warningf logs a message at level Warn on the standard logger. +func Warningf(format string, args ...interface{}) { + std.Warningf(format, args...) +} + +// Errorf logs a message at level Error on the standard logger. +func Errorf(format string, args ...interface{}) { + std.Errorf(format, args...) +} + +// Panicf logs a message at level Panic on the standard logger. +func Panicf(format string, args ...interface{}) { + std.Panicf(format, args...) +} + +// Fatalf logs a message at level Fatal on the standard logger. +func Fatalf(format string, args ...interface{}) { + std.Fatalf(format, args...) +} + +// Debugln logs a message at level Debug on the standard logger. +func Debugln(args ...interface{}) { + std.Debugln(args...) +} + +// Println logs a message at level Info on the standard logger. +func Println(args ...interface{}) { + std.Println(args...) +} + +// Infoln logs a message at level Info on the standard logger. +func Infoln(args ...interface{}) { + std.Infoln(args...) +} + +// Warnln logs a message at level Warn on the standard logger. +func Warnln(args ...interface{}) { + std.Warnln(args...) +} + +// Warningln logs a message at level Warn on the standard logger. +func Warningln(args ...interface{}) { + std.Warningln(args...) +} + +// Errorln logs a message at level Error on the standard logger. +func Errorln(args ...interface{}) { + std.Errorln(args...) +} + +// Panicln logs a message at level Panic on the standard logger. +func Panicln(args ...interface{}) { + std.Panicln(args...) +} + +// Fatalln logs a message at level Fatal on the standard logger. +func Fatalln(args ...interface{}) { + std.Fatalln(args...) +} diff --git a/vendor/github.com/Sirupsen/logrus/formatter.go b/vendor/github.com/Sirupsen/logrus/formatter.go new file mode 100644 index 000000000..038ce9fd2 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/formatter.go @@ -0,0 +1,44 @@ +package logrus + +// The Formatter interface is used to implement a custom Formatter. It takes an +// `Entry`. It exposes all the fields, including the default ones: +// +// * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. +// * `entry.Data["time"]`. The timestamp. +// * `entry.Data["level"]. The level the entry was logged at. +// +// Any additional fields added with `WithField` or `WithFields` are also in +// `entry.Data`. Format is expected to return an array of bytes which are then +// logged to `logger.Out`. +type Formatter interface { + Format(*Entry) ([]byte, error) +} + +// This is to not silently overwrite `time`, `msg` and `level` fields when +// dumping it. If this code wasn't there doing: +// +// logrus.WithField("level", 1).Info("hello") +// +// Would just silently drop the user provided level. Instead with this code +// it'll logged as: +// +// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} +// +// It's not exported because it's still using Data in an opinionated way. It's to +// avoid code duplication between the two default formatters. +func prefixFieldClashes(data Fields) { + _, ok := data["time"] + if ok { + data["fields.time"] = data["time"] + } + + _, ok = data["msg"] + if ok { + data["fields.msg"] = data["msg"] + } + + _, ok = data["level"] + if ok { + data["fields.level"] = data["level"] + } +} diff --git a/vendor/github.com/Sirupsen/logrus/hooks.go b/vendor/github.com/Sirupsen/logrus/hooks.go new file mode 100644 index 000000000..0da2b3653 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/hooks.go @@ -0,0 +1,34 @@ +package logrus + +// A hook to be fired when logging on the logging levels returned from +// `Levels()` on your implementation of the interface. Note that this is not +// fired in a goroutine or a channel with workers, you should handle such +// functionality yourself if your call is non-blocking and you don't wish for +// the logging calls for levels returned from `Levels()` to block. +type Hook interface { + Levels() []Level + Fire(*Entry) error +} + +// Internal type for storing the hooks on a logger instance. +type levelHooks map[Level][]Hook + +// Add a hook to an instance of logger. This is called with +// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. +func (hooks levelHooks) Add(hook Hook) { + for _, level := range hook.Levels() { + hooks[level] = append(hooks[level], hook) + } +} + +// Fire all the hooks for the passed level. Used by `entry.log` to fire +// appropriate hooks for a log entry. +func (hooks levelHooks) Fire(level Level, entry *Entry) error { + for _, hook := range hooks[level] { + if err := hook.Fire(entry); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/Sirupsen/logrus/json_formatter.go b/vendor/github.com/Sirupsen/logrus/json_formatter.go new file mode 100644 index 000000000..b09227c2b --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/json_formatter.go @@ -0,0 +1,26 @@ +package logrus + +import ( + "encoding/json" + "fmt" + "time" +) + +type JSONFormatter struct{} + +func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { + data := make(Fields, len(entry.Data)+3) + for k, v := range entry.Data { + data[k] = v + } + prefixFieldClashes(data) + data["time"] = entry.Time.Format(time.RFC3339) + data["msg"] = entry.Message + data["level"] = entry.Level.String() + + serialized, err := json.Marshal(data) + if err != nil { + return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) + } + return append(serialized, '\n'), nil +} diff --git a/vendor/github.com/Sirupsen/logrus/logger.go b/vendor/github.com/Sirupsen/logrus/logger.go new file mode 100644 index 000000000..b392e547a --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/logger.go @@ -0,0 +1,161 @@ +package logrus + +import ( + "io" + "os" + "sync" +) + +type Logger struct { + // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a + // file, or leave it default which is `os.Stdout`. You can also set this to + // something more adventorous, such as logging to Kafka. + Out io.Writer + // Hooks for the logger instance. These allow firing events based on logging + // levels and log entries. For example, to send errors to an error tracking + // service, log to StatsD or dump the core on fatal errors. + Hooks levelHooks + // All log entries pass through the formatter before logged to Out. The + // included formatters are `TextFormatter` and `JSONFormatter` for which + // TextFormatter is the default. In development (when a TTY is attached) it + // logs with colors, but to a file it wouldn't. You can easily implement your + // own that implements the `Formatter` interface, see the `README` or included + // formatters for examples. + Formatter Formatter + // The logging level the logger should log at. This is typically (and defaults + // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be + // logged. `logrus.Debug` is useful in + Level Level + // Used to sync writing to the log. + mu sync.Mutex +} + +// Creates a new logger. Configuration should be set by changing `Formatter`, +// `Out` and `Hooks` directly on the default logger instance. You can also just +// instantiate your own: +// +// var log = &Logger{ +// Out: os.Stderr, +// Formatter: new(JSONFormatter), +// Hooks: make(levelHooks), +// Level: logrus.DebugLevel, +// } +// +// It's recommended to make this a global instance called `log`. +func New() *Logger { + return &Logger{ + Out: os.Stdout, + Formatter: new(TextFormatter), + Hooks: make(levelHooks), + Level: InfoLevel, + } +} + +// Adds a field to the log entry, note that you it doesn't log until you call +// Debug, Print, Info, Warn, Fatal or Panic. It only creates a log entry. +// Ff you want multiple fields, use `WithFields`. +func (logger *Logger) WithField(key string, value interface{}) *Entry { + return NewEntry(logger).WithField(key, value) +} + +// Adds a struct of fields to the log entry. All it does is call `WithField` for +// each `Field`. +func (logger *Logger) WithFields(fields Fields) *Entry { + return NewEntry(logger).WithFields(fields) +} + +func (logger *Logger) Debugf(format string, args ...interface{}) { + NewEntry(logger).Debugf(format, args...) +} + +func (logger *Logger) Infof(format string, args ...interface{}) { + NewEntry(logger).Infof(format, args...) +} + +func (logger *Logger) Printf(format string, args ...interface{}) { + NewEntry(logger).Printf(format, args...) +} + +func (logger *Logger) Warnf(format string, args ...interface{}) { + NewEntry(logger).Warnf(format, args...) +} + +func (logger *Logger) Warningf(format string, args ...interface{}) { + NewEntry(logger).Warnf(format, args...) +} + +func (logger *Logger) Errorf(format string, args ...interface{}) { + NewEntry(logger).Errorf(format, args...) +} + +func (logger *Logger) Fatalf(format string, args ...interface{}) { + NewEntry(logger).Fatalf(format, args...) +} + +func (logger *Logger) Panicf(format string, args ...interface{}) { + NewEntry(logger).Panicf(format, args...) +} + +func (logger *Logger) Debug(args ...interface{}) { + NewEntry(logger).Debug(args...) +} + +func (logger *Logger) Info(args ...interface{}) { + NewEntry(logger).Info(args...) +} + +func (logger *Logger) Print(args ...interface{}) { + NewEntry(logger).Info(args...) +} + +func (logger *Logger) Warn(args ...interface{}) { + NewEntry(logger).Warn(args...) +} + +func (logger *Logger) Warning(args ...interface{}) { + NewEntry(logger).Warn(args...) +} + +func (logger *Logger) Error(args ...interface{}) { + NewEntry(logger).Error(args...) +} + +func (logger *Logger) Fatal(args ...interface{}) { + NewEntry(logger).Fatal(args...) +} + +func (logger *Logger) Panic(args ...interface{}) { + NewEntry(logger).Panic(args...) +} + +func (logger *Logger) Debugln(args ...interface{}) { + NewEntry(logger).Debugln(args...) +} + +func (logger *Logger) Infoln(args ...interface{}) { + NewEntry(logger).Infoln(args...) +} + +func (logger *Logger) Println(args ...interface{}) { + NewEntry(logger).Println(args...) +} + +func (logger *Logger) Warnln(args ...interface{}) { + NewEntry(logger).Warnln(args...) +} + +func (logger *Logger) Warningln(args ...interface{}) { + NewEntry(logger).Warnln(args...) +} + +func (logger *Logger) Errorln(args ...interface{}) { + NewEntry(logger).Errorln(args...) +} + +func (logger *Logger) Fatalln(args ...interface{}) { + NewEntry(logger).Fatalln(args...) +} + +func (logger *Logger) Panicln(args ...interface{}) { + NewEntry(logger).Panicln(args...) +} diff --git a/vendor/github.com/Sirupsen/logrus/logrus.go b/vendor/github.com/Sirupsen/logrus/logrus.go new file mode 100644 index 000000000..43ee12e90 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/logrus.go @@ -0,0 +1,94 @@ +package logrus + +import ( + "fmt" + "log" +) + +// Fields type, used to pass to `WithFields`. +type Fields map[string]interface{} + +// Level type +type Level uint8 + +// Convert the Level to a string. E.g. PanicLevel becomes "panic". +func (level Level) String() string { + switch level { + case DebugLevel: + return "debug" + case InfoLevel: + return "info" + case WarnLevel: + return "warning" + case ErrorLevel: + return "error" + case FatalLevel: + return "fatal" + case PanicLevel: + return "panic" + } + + return "unknown" +} + +// ParseLevel takes a string level and returns the Logrus log level constant. +func ParseLevel(lvl string) (Level, error) { + switch lvl { + case "panic": + return PanicLevel, nil + case "fatal": + return FatalLevel, nil + case "error": + return ErrorLevel, nil + case "warn", "warning": + return WarnLevel, nil + case "info": + return InfoLevel, nil + case "debug": + return DebugLevel, nil + } + + var l Level + return l, fmt.Errorf("not a valid logrus Level: %q", lvl) +} + +// These are the different logging levels. You can set the logging level to log +// on your instance of logger, obtained with `logrus.New()`. +const ( + // PanicLevel level, highest level of severity. Logs and then calls panic with the + // message passed to Debug, Info, ... + PanicLevel Level = iota + // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the + // logging level is set to Panic. + FatalLevel + // ErrorLevel level. Logs. Used for errors that should definitely be noted. + // Commonly used for hooks to send errors to an error tracking service. + ErrorLevel + // WarnLevel level. Non-critical entries that deserve eyes. + WarnLevel + // InfoLevel level. General operational entries about what's going on inside the + // application. + InfoLevel + // DebugLevel level. Usually only enabled when debugging. Very verbose logging. + DebugLevel +) + +// Won't compile if StdLogger can't be realized by a log.Logger +var _ StdLogger = &log.Logger{} + +// StdLogger is what your logrus-enabled library should take, that way +// it'll accept a stdlib logger and a logrus logger. There's no standard +// interface, this is the closest we get, unfortunately. +type StdLogger interface { + Print(...interface{}) + Printf(string, ...interface{}) + Println(...interface{}) + + Fatal(...interface{}) + Fatalf(string, ...interface{}) + Fatalln(...interface{}) + + Panic(...interface{}) + Panicf(string, ...interface{}) + Panicln(...interface{}) +} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_darwin.go b/vendor/github.com/Sirupsen/logrus/terminal_darwin.go new file mode 100644 index 000000000..8fe02a4ae --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/terminal_darwin.go @@ -0,0 +1,12 @@ +// Based on ssh/terminal: +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package logrus + +import "syscall" + +const ioctlReadTermios = syscall.TIOCGETA + +type Termios syscall.Termios diff --git a/vendor/github.com/Sirupsen/logrus/terminal_freebsd.go b/vendor/github.com/Sirupsen/logrus/terminal_freebsd.go new file mode 100644 index 000000000..0428ee5d5 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/terminal_freebsd.go @@ -0,0 +1,20 @@ +/* + Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin. +*/ +package logrus + +import ( + "syscall" +) + +const ioctlReadTermios = syscall.TIOCGETA + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Cc [20]uint8 + Ispeed uint32 + Ospeed uint32 +} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_linux.go b/vendor/github.com/Sirupsen/logrus/terminal_linux.go new file mode 100644 index 000000000..a2c0b40db --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/terminal_linux.go @@ -0,0 +1,12 @@ +// Based on ssh/terminal: +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package logrus + +import "syscall" + +const ioctlReadTermios = syscall.TCGETS + +type Termios syscall.Termios diff --git a/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go b/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go new file mode 100644 index 000000000..276447bd5 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go @@ -0,0 +1,21 @@ +// Based on ssh/terminal: +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux,!appengine darwin freebsd + +package logrus + +import ( + "syscall" + "unsafe" +) + +// IsTerminal returns true if the given file descriptor is a terminal. +func IsTerminal() bool { + fd := syscall.Stdout + var termios Termios + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 +} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_windows.go b/vendor/github.com/Sirupsen/logrus/terminal_windows.go new file mode 100644 index 000000000..2e09f6f7e --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/terminal_windows.go @@ -0,0 +1,27 @@ +// Based on ssh/terminal: +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build windows + +package logrus + +import ( + "syscall" + "unsafe" +) + +var kernel32 = syscall.NewLazyDLL("kernel32.dll") + +var ( + procGetConsoleMode = kernel32.NewProc("GetConsoleMode") +) + +// IsTerminal returns true if the given file descriptor is a terminal. +func IsTerminal() bool { + fd := syscall.Stdout + var st uint32 + r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) + return r != 0 && e == 0 +} diff --git a/vendor/github.com/Sirupsen/logrus/text_formatter.go b/vendor/github.com/Sirupsen/logrus/text_formatter.go new file mode 100644 index 000000000..78e788935 --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/text_formatter.go @@ -0,0 +1,124 @@ +package logrus + +import ( + "bytes" + "fmt" + "regexp" + "sort" + "strings" + "time" +) + +const ( + nocolor = 0 + red = 31 + green = 32 + yellow = 33 + blue = 34 +) + +var ( + baseTimestamp time.Time + isTerminal bool + noQuoteNeeded *regexp.Regexp +) + +func init() { + baseTimestamp = time.Now() + isTerminal = IsTerminal() +} + +func miniTS() int { + return int(time.Since(baseTimestamp) / time.Second) +} + +type TextFormatter struct { + // Set to true to bypass checking for a TTY before outputting colors. + ForceColors bool + DisableColors bool + // Set to true to disable timestamp logging (useful when the output + // is redirected to a logging system already adding a timestamp) + DisableTimestamp bool +} + +func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { + + var keys []string + for k := range entry.Data { + keys = append(keys, k) + } + sort.Strings(keys) + + b := &bytes.Buffer{} + + prefixFieldClashes(entry.Data) + + isColored := (f.ForceColors || isTerminal) && !f.DisableColors + + if isColored { + printColored(b, entry, keys) + } else { + if !f.DisableTimestamp { + f.appendKeyValue(b, "time", entry.Time.Format(time.RFC3339)) + } + f.appendKeyValue(b, "level", entry.Level.String()) + f.appendKeyValue(b, "msg", entry.Message) + for _, key := range keys { + f.appendKeyValue(b, key, entry.Data[key]) + } + } + + b.WriteByte('\n') + return b.Bytes(), nil +} + +func printColored(b *bytes.Buffer, entry *Entry, keys []string) { + var levelColor int + switch entry.Level { + case WarnLevel: + levelColor = yellow + case ErrorLevel, FatalLevel, PanicLevel: + levelColor = red + default: + levelColor = blue + } + + levelText := strings.ToUpper(entry.Level.String())[0:4] + + fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, miniTS(), entry.Message) + for _, k := range keys { + v := entry.Data[k] + fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=%v", levelColor, k, v) + } +} + +func needsQuoting(text string) bool { + for _, ch := range text { + if !((ch >= 'a' && ch <= 'z') || + (ch >= 'A' && ch <= 'Z') || + (ch >= '0' && ch < '9') || + ch == '-' || ch == '.') { + return false + } + } + return true +} + +func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key, value interface{}) { + switch value.(type) { + case string: + if needsQuoting(value.(string)) { + fmt.Fprintf(b, "%v=%s ", key, value) + } else { + fmt.Fprintf(b, "%v=%q ", key, value) + } + case error: + if needsQuoting(value.(error).Error()) { + fmt.Fprintf(b, "%v=%s ", key, value) + } else { + fmt.Fprintf(b, "%v=%q ", key, value) + } + default: + fmt.Fprintf(b, "%v=%v ", key, value) + } +} diff --git a/vendor/github.com/docker/docker/LICENSE b/vendor/github.com/docker/docker/LICENSE deleted file mode 100644 index c7a3f0cfd..000000000 --- a/vendor/github.com/docker/docker/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2013-2015 Docker, Inc. - - 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 - - https://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. diff --git a/vendor/github.com/docker/docker/NOTICE b/vendor/github.com/docker/docker/NOTICE deleted file mode 100644 index 6e6f469ab..000000000 --- a/vendor/github.com/docker/docker/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/kr/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/github.com/docker/docker/pkg/mount/flags.go b/vendor/github.com/docker/docker/pkg/mount/flags.go deleted file mode 100644 index 17dbd7a64..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/flags.go +++ /dev/null @@ -1,69 +0,0 @@ -package mount - -import ( - "strings" -) - -// Parse fstab type mount options into mount() flags -// and device specific data -func parseOptions(options string) (int, string) { - var ( - flag int - data []string - ) - - flags := map[string]struct { - clear bool - flag int - }{ - "defaults": {false, 0}, - "ro": {false, RDONLY}, - "rw": {true, RDONLY}, - "suid": {true, NOSUID}, - "nosuid": {false, NOSUID}, - "dev": {true, NODEV}, - "nodev": {false, NODEV}, - "exec": {true, NOEXEC}, - "noexec": {false, NOEXEC}, - "sync": {false, SYNCHRONOUS}, - "async": {true, SYNCHRONOUS}, - "dirsync": {false, DIRSYNC}, - "remount": {false, REMOUNT}, - "mand": {false, MANDLOCK}, - "nomand": {true, MANDLOCK}, - "atime": {true, NOATIME}, - "noatime": {false, NOATIME}, - "diratime": {true, NODIRATIME}, - "nodiratime": {false, NODIRATIME}, - "bind": {false, BIND}, - "rbind": {false, RBIND}, - "unbindable": {false, UNBINDABLE}, - "runbindable": {false, RUNBINDABLE}, - "private": {false, PRIVATE}, - "rprivate": {false, RPRIVATE}, - "shared": {false, SHARED}, - "rshared": {false, RSHARED}, - "slave": {false, SLAVE}, - "rslave": {false, RSLAVE}, - "relatime": {false, RELATIME}, - "norelatime": {true, RELATIME}, - "strictatime": {false, STRICTATIME}, - "nostrictatime": {true, STRICTATIME}, - } - - for _, o := range strings.Split(options, ",") { - // If the option does not exist in the flags table or the flag - // is not supported on the platform, - // then it is a data value for a specific fs type - if f, exists := flags[o]; exists && f.flag != 0 { - if f.clear { - flag &= ^f.flag - } else { - flag |= f.flag - } - } else { - data = append(data, o) - } - } - return flag, strings.Join(data, ",") -} diff --git a/vendor/github.com/docker/docker/pkg/mount/flags_freebsd.go b/vendor/github.com/docker/docker/pkg/mount/flags_freebsd.go deleted file mode 100644 index f166cb2f7..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/flags_freebsd.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build freebsd,cgo - -package mount - -/* -#include -*/ -import "C" - -const ( - // RDONLY will mount the filesystem as read-only. - RDONLY = C.MNT_RDONLY - - // NOSUID will not allow set-user-identifier or set-group-identifier bits to - // take effect. - NOSUID = C.MNT_NOSUID - - // NOEXEC will not allow execution of any binaries on the mounted file system. - NOEXEC = C.MNT_NOEXEC - - // SYNCHRONOUS will allow any I/O to the file system to be done synchronously. - SYNCHRONOUS = C.MNT_SYNCHRONOUS - - // NOATIME will not update the file access time when reading from a file. - NOATIME = C.MNT_NOATIME -) - -// These flags are unsupported. -const ( - BIND = 0 - DIRSYNC = 0 - MANDLOCK = 0 - NODEV = 0 - NODIRATIME = 0 - UNBINDABLE = 0 - RUNBINDABLE = 0 - PRIVATE = 0 - RPRIVATE = 0 - SHARED = 0 - RSHARED = 0 - SLAVE = 0 - RSLAVE = 0 - RBIND = 0 - RELATIVE = 0 - RELATIME = 0 - REMOUNT = 0 - STRICTATIME = 0 -) diff --git a/vendor/github.com/docker/docker/pkg/mount/flags_linux.go b/vendor/github.com/docker/docker/pkg/mount/flags_linux.go deleted file mode 100644 index 2f9f5c58e..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/flags_linux.go +++ /dev/null @@ -1,85 +0,0 @@ -package mount - -import ( - "syscall" -) - -const ( - // RDONLY will mount the file system read-only. - RDONLY = syscall.MS_RDONLY - - // NOSUID will not allow set-user-identifier or set-group-identifier bits to - // take effect. - NOSUID = syscall.MS_NOSUID - - // NODEV will not interpret character or block special devices on the file - // system. - NODEV = syscall.MS_NODEV - - // NOEXEC will not allow execution of any binaries on the mounted file system. - NOEXEC = syscall.MS_NOEXEC - - // SYNCHRONOUS will allow I/O to the file system to be done synchronously. - SYNCHRONOUS = syscall.MS_SYNCHRONOUS - - // DIRSYNC will force all directory updates within the file system to be done - // synchronously. This affects the following system calls: creat, link, - // unlink, symlink, mkdir, rmdir, mknod and rename. - DIRSYNC = syscall.MS_DIRSYNC - - // REMOUNT will attempt to remount an already-mounted file system. This is - // commonly used to change the mount flags for a file system, especially to - // make a readonly file system writeable. It does not change device or mount - // point. - REMOUNT = syscall.MS_REMOUNT - - // MANDLOCK will force mandatory locks on a filesystem. - MANDLOCK = syscall.MS_MANDLOCK - - // NOATIME will not update the file access time when reading from a file. - NOATIME = syscall.MS_NOATIME - - // NODIRATIME will not update the directory access time. - NODIRATIME = syscall.MS_NODIRATIME - - // BIND remounts a subtree somewhere else. - BIND = syscall.MS_BIND - - // RBIND remounts a subtree and all possible submounts somewhere else. - RBIND = syscall.MS_BIND | syscall.MS_REC - - // UNBINDABLE creates a mount which cannot be cloned through a bind operation. - UNBINDABLE = syscall.MS_UNBINDABLE - - // RUNBINDABLE marks the entire mount tree as UNBINDABLE. - RUNBINDABLE = syscall.MS_UNBINDABLE | syscall.MS_REC - - // PRIVATE creates a mount which carries no propagation abilities. - PRIVATE = syscall.MS_PRIVATE - - // RPRIVATE marks the entire mount tree as PRIVATE. - RPRIVATE = syscall.MS_PRIVATE | syscall.MS_REC - - // SLAVE creates a mount which receives propagation from its master, but not - // vice versa. - SLAVE = syscall.MS_SLAVE - - // RSLAVE marks the entire mount tree as SLAVE. - RSLAVE = syscall.MS_SLAVE | syscall.MS_REC - - // SHARED creates a mount which provides the ability to create mirrors of - // that mount such that mounts and unmounts within any of the mirrors - // propagate to the other mirrors. - SHARED = syscall.MS_SHARED - - // RSHARED marks the entire mount tree as SHARED. - RSHARED = syscall.MS_SHARED | syscall.MS_REC - - // RELATIME updates inode access times relative to modify or change time. - RELATIME = syscall.MS_RELATIME - - // STRICTATIME allows to explicitly request full atime updates. This makes - // it possible for the kernel to default to relatime or noatime but still - // allow userspace to override it. - STRICTATIME = syscall.MS_STRICTATIME -) diff --git a/vendor/github.com/docker/docker/pkg/mount/flags_unsupported.go b/vendor/github.com/docker/docker/pkg/mount/flags_unsupported.go deleted file mode 100644 index a90d3d115..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/flags_unsupported.go +++ /dev/null @@ -1,30 +0,0 @@ -// +build !linux,!freebsd freebsd,!cgo - -package mount - -// These flags are unsupported. -const ( - BIND = 0 - DIRSYNC = 0 - MANDLOCK = 0 - NOATIME = 0 - NODEV = 0 - NODIRATIME = 0 - NOEXEC = 0 - NOSUID = 0 - UNBINDABLE = 0 - RUNBINDABLE = 0 - PRIVATE = 0 - RPRIVATE = 0 - SHARED = 0 - RSHARED = 0 - SLAVE = 0 - RSLAVE = 0 - RBIND = 0 - RELATIME = 0 - RELATIVE = 0 - REMOUNT = 0 - STRICTATIME = 0 - SYNCHRONOUS = 0 - RDONLY = 0 -) diff --git a/vendor/github.com/docker/docker/pkg/mount/mount.go b/vendor/github.com/docker/docker/pkg/mount/mount.go deleted file mode 100644 index ed7216e5c..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mount.go +++ /dev/null @@ -1,74 +0,0 @@ -package mount - -import ( - "time" -) - -// GetMounts retrieves a list of mounts for the current running process. -func GetMounts() ([]*Info, error) { - return parseMountTable() -} - -// Mounted looks at /proc/self/mountinfo to determine of the specified -// mountpoint has been mounted -func Mounted(mountpoint string) (bool, error) { - entries, err := parseMountTable() - if err != nil { - return false, err - } - - // Search the table for the mountpoint - for _, e := range entries { - if e.Mountpoint == mountpoint { - return true, nil - } - } - return false, nil -} - -// Mount will mount filesystem according to the specified configuration, on the -// condition that the target path is *not* already mounted. Options must be -// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See -// flags.go for supported option flags. -func Mount(device, target, mType, options string) error { - flag, _ := parseOptions(options) - if flag&REMOUNT != REMOUNT { - if mounted, err := Mounted(target); err != nil || mounted { - return err - } - } - return ForceMount(device, target, mType, options) -} - -// ForceMount will mount a filesystem according to the specified configuration, -// *regardless* if the target path is not already mounted. Options must be -// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See -// flags.go for supported option flags. -func ForceMount(device, target, mType, options string) error { - flag, data := parseOptions(options) - if err := mount(device, target, mType, uintptr(flag), data); err != nil { - return err - } - return nil -} - -// Unmount will unmount the target filesystem, so long as it is mounted. -func Unmount(target string) error { - if mounted, err := Mounted(target); err != nil || !mounted { - return err - } - return ForceUnmount(target) -} - -// ForceUnmount will force an unmount of the target filesystem, regardless if -// it is mounted or not. -func ForceUnmount(target string) (err error) { - // Simple retry logic for unmount - for i := 0; i < 10; i++ { - if err = unmount(target, 0); err == nil { - return nil - } - time.Sleep(100 * time.Millisecond) - } - return -} diff --git a/vendor/github.com/docker/docker/pkg/mount/mounter_freebsd.go b/vendor/github.com/docker/docker/pkg/mount/mounter_freebsd.go deleted file mode 100644 index bb870e6f5..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mounter_freebsd.go +++ /dev/null @@ -1,59 +0,0 @@ -package mount - -/* -#include -#include -#include -#include -#include -#include -*/ -import "C" - -import ( - "fmt" - "strings" - "syscall" - "unsafe" -) - -func allocateIOVecs(options []string) []C.struct_iovec { - out := make([]C.struct_iovec, len(options)) - for i, option := range options { - out[i].iov_base = unsafe.Pointer(C.CString(option)) - out[i].iov_len = C.size_t(len(option) + 1) - } - return out -} - -func mount(device, target, mType string, flag uintptr, data string) error { - isNullFS := false - - xs := strings.Split(data, ",") - for _, x := range xs { - if x == "bind" { - isNullFS = true - } - } - - options := []string{"fspath", target} - if isNullFS { - options = append(options, "fstype", "nullfs", "target", device) - } else { - options = append(options, "fstype", mType, "from", device) - } - rawOptions := allocateIOVecs(options) - for _, rawOption := range rawOptions { - defer C.free(rawOption.iov_base) - } - - if errno := C.nmount(&rawOptions[0], C.uint(len(options)), C.int(flag)); errno != 0 { - reason := C.GoString(C.strerror(*C.__error())) - return fmt.Errorf("Failed to call nmount: %s", reason) - } - return nil -} - -func unmount(target string, flag int) error { - return syscall.Unmount(target, flag) -} diff --git a/vendor/github.com/docker/docker/pkg/mount/mounter_linux.go b/vendor/github.com/docker/docker/pkg/mount/mounter_linux.go deleted file mode 100644 index dd4280c77..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mounter_linux.go +++ /dev/null @@ -1,21 +0,0 @@ -package mount - -import ( - "syscall" -) - -func mount(device, target, mType string, flag uintptr, data string) error { - if err := syscall.Mount(device, target, mType, flag, data); err != nil { - return err - } - - // If we have a bind mount or remount, remount... - if flag&syscall.MS_BIND == syscall.MS_BIND && flag&syscall.MS_RDONLY == syscall.MS_RDONLY { - return syscall.Mount(device, target, mType, flag|syscall.MS_REMOUNT, data) - } - return nil -} - -func unmount(target string, flag int) error { - return syscall.Unmount(target, flag) -} diff --git a/vendor/github.com/docker/docker/pkg/mount/mounter_unsupported.go b/vendor/github.com/docker/docker/pkg/mount/mounter_unsupported.go deleted file mode 100644 index eb93365eb..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mounter_unsupported.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !linux,!freebsd freebsd,!cgo - -package mount - -func mount(device, target, mType string, flag uintptr, data string) error { - panic("Not implemented") -} - -func unmount(target string, flag int) error { - panic("Not implemented") -} diff --git a/vendor/github.com/docker/docker/pkg/mount/mountinfo.go b/vendor/github.com/docker/docker/pkg/mount/mountinfo.go deleted file mode 100644 index e3fc3535e..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mountinfo.go +++ /dev/null @@ -1,40 +0,0 @@ -package mount - -// Info reveals information about a particular mounted filesystem. This -// struct is populated from the content in the /proc//mountinfo file. -type Info struct { - // ID is a unique identifier of the mount (may be reused after umount). - ID int - - // Parent indicates the ID of the mount parent (or of self for the top of the - // mount tree). - Parent int - - // Major indicates one half of the device ID which identifies the device class. - Major int - - // Minor indicates one half of the device ID which identifies a specific - // instance of device. - Minor int - - // Root of the mount within the filesystem. - Root string - - // Mountpoint indicates the mount point relative to the process's root. - Mountpoint string - - // Opts represents mount-specific options. - Opts string - - // Optional represents optional fields. - Optional string - - // Fstype indicates the type of filesystem, such as EXT3. - Fstype string - - // Source indicates filesystem specific information or "none". - Source string - - // VfsOpts represents per super block options. - VfsOpts string -} diff --git a/vendor/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go b/vendor/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go deleted file mode 100644 index 4f32edcd9..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go +++ /dev/null @@ -1,41 +0,0 @@ -package mount - -/* -#include -#include -#include -*/ -import "C" - -import ( - "fmt" - "reflect" - "unsafe" -) - -// Parse /proc/self/mountinfo because comparing Dev and ino does not work from -// bind mounts. -func parseMountTable() ([]*Info, error) { - var rawEntries *C.struct_statfs - - count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) - if count == 0 { - return nil, fmt.Errorf("Failed to call getmntinfo") - } - - var entries []C.struct_statfs - header := (*reflect.SliceHeader)(unsafe.Pointer(&entries)) - header.Cap = count - header.Len = count - header.Data = uintptr(unsafe.Pointer(rawEntries)) - - var out []*Info - for _, entry := range entries { - var mountinfo Info - mountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0]) - mountinfo.Source = C.GoString(&entry.f_mntfromname[0]) - mountinfo.Fstype = C.GoString(&entry.f_fstypename[0]) - out = append(out, &mountinfo) - } - return out, nil -} diff --git a/vendor/github.com/docker/docker/pkg/mount/mountinfo_linux.go b/vendor/github.com/docker/docker/pkg/mount/mountinfo_linux.go deleted file mode 100644 index be69fee1d..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mountinfo_linux.go +++ /dev/null @@ -1,95 +0,0 @@ -// +build linux - -package mount - -import ( - "bufio" - "fmt" - "io" - "os" - "strings" -) - -const ( - /* 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue - (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) - - (1) mount ID: unique identifier of the mount (may be reused after umount) - (2) parent ID: ID of parent (or of self for the top of the mount tree) - (3) major:minor: value of st_dev for files on filesystem - (4) root: root of the mount within the filesystem - (5) mount point: mount point relative to the process's root - (6) mount options: per mount options - (7) optional fields: zero or more fields of the form "tag[:value]" - (8) separator: marks the end of the optional fields - (9) filesystem type: name of filesystem of the form "type[.subtype]" - (10) mount source: filesystem specific information or "none" - (11) super options: per super block options*/ - mountinfoFormat = "%d %d %d:%d %s %s %s %s" -) - -// Parse /proc/self/mountinfo because comparing Dev and ino does not work from -// bind mounts -func parseMountTable() ([]*Info, error) { - f, err := os.Open("/proc/self/mountinfo") - if err != nil { - return nil, err - } - defer f.Close() - - return parseInfoFile(f) -} - -func parseInfoFile(r io.Reader) ([]*Info, error) { - var ( - s = bufio.NewScanner(r) - out = []*Info{} - ) - - for s.Scan() { - if err := s.Err(); err != nil { - return nil, err - } - - var ( - p = &Info{} - text = s.Text() - optionalFields string - ) - - if _, err := fmt.Sscanf(text, mountinfoFormat, - &p.ID, &p.Parent, &p.Major, &p.Minor, - &p.Root, &p.Mountpoint, &p.Opts, &optionalFields); err != nil { - return nil, fmt.Errorf("Scanning '%s' failed: %s", text, err) - } - // Safe as mountinfo encodes mountpoints with spaces as \040. - index := strings.Index(text, " - ") - postSeparatorFields := strings.Fields(text[index+3:]) - if len(postSeparatorFields) < 3 { - return nil, fmt.Errorf("Error found less than 3 fields post '-' in %q", text) - } - - if optionalFields != "-" { - p.Optional = optionalFields - } - - p.Fstype = postSeparatorFields[0] - p.Source = postSeparatorFields[1] - p.VfsOpts = strings.Join(postSeparatorFields[2:], " ") - out = append(out, p) - } - return out, nil -} - -// PidMountInfo collects the mounts for a specific process ID. If the process -// ID is unknown, it is better to use `GetMounts` which will inspect -// "/proc/self/mountinfo" instead. -func PidMountInfo(pid int) ([]*Info, error) { - f, err := os.Open(fmt.Sprintf("/proc/%d/mountinfo", pid)) - if err != nil { - return nil, err - } - defer f.Close() - - return parseInfoFile(f) -} diff --git a/vendor/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go b/vendor/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go deleted file mode 100644 index 8245f01d4..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build !linux,!freebsd freebsd,!cgo - -package mount - -import ( - "fmt" - "runtime" -) - -func parseMountTable() ([]*Info, error) { - return nil, fmt.Errorf("mount.parseMountTable is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} diff --git a/vendor/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go b/vendor/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go deleted file mode 100644 index 47303bbcb..000000000 --- a/vendor/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go +++ /dev/null @@ -1,70 +0,0 @@ -// +build linux - -package mount - -// MakeShared ensures a mounted filesystem has the SHARED mount option enabled. -// See the supported options in flags.go for further reference. -func MakeShared(mountPoint string) error { - return ensureMountedAs(mountPoint, "shared") -} - -// MakeRShared ensures a mounted filesystem has the RSHARED mount option enabled. -// See the supported options in flags.go for further reference. -func MakeRShared(mountPoint string) error { - return ensureMountedAs(mountPoint, "rshared") -} - -// MakePrivate ensures a mounted filesystem has the PRIVATE mount option enabled. -// See the supported options in flags.go for further reference. -func MakePrivate(mountPoint string) error { - return ensureMountedAs(mountPoint, "private") -} - -// MakeRPrivate ensures a mounted filesystem has the RPRIVATE mount option -// enabled. See the supported options in flags.go for further reference. -func MakeRPrivate(mountPoint string) error { - return ensureMountedAs(mountPoint, "rprivate") -} - -// MakeSlave ensures a mounted filesystem has the SLAVE mount option enabled. -// See the supported options in flags.go for further reference. -func MakeSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "slave") -} - -// MakeRSlave ensures a mounted filesystem has the RSLAVE mount option enabled. -// See the supported options in flags.go for further reference. -func MakeRSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "rslave") -} - -// MakeUnbindable ensures a mounted filesystem has the UNBINDABLE mount option -// enabled. See the supported options in flags.go for further reference. -func MakeUnbindable(mountPoint string) error { - return ensureMountedAs(mountPoint, "unbindable") -} - -// MakeRUnbindable ensures a mounted filesystem has the RUNBINDABLE mount -// option enabled. See the supported options in flags.go for further reference. -func MakeRUnbindable(mountPoint string) error { - return ensureMountedAs(mountPoint, "runbindable") -} - -func ensureMountedAs(mountPoint, options string) error { - mounted, err := Mounted(mountPoint) - if err != nil { - return err - } - - if !mounted { - if err := Mount(mountPoint, mountPoint, "none", "bind,rw"); err != nil { - return err - } - } - mounted, err = Mounted(mountPoint) - if err != nil { - return err - } - - return ForceMount("", mountPoint, "none", options) -} diff --git a/vendor/github.com/emicklei/go-restful/README.md b/vendor/github.com/emicklei/go-restful/README.md index 8f954c016..e5492e476 100644 --- a/vendor/github.com/emicklei/go-restful/README.md +++ b/vendor/github.com/emicklei/go-restful/README.md @@ -40,7 +40,7 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo - Routes for request → function mapping with path parameter (e.g. {id}) support - Configurable router: - - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but doest **not** accept) regular expressions (See RouterJSR311 which is used by default) + - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions (See RouterJSR311 which is used by default) - Fast routing algorithm that allows static elements, regular expressions and dynamic parameters in the URL path (e.g. /meetings/{id} or /static/{subpath:*}, See CurlyRouter) - Request API for reading structs from JSON/XML and accesing parameters (path,query,header) - Response API for writing structs to JSON/XML and setting headers @@ -71,4 +71,4 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo (c) 2012 - 2015, http://ernestmicklei.com. MIT License -Type ```git shortlog -s``` for a full list of contributors. \ No newline at end of file +Type ```git shortlog -s``` for a full list of contributors. diff --git a/vendor/github.com/emicklei/go-restful/curly.go b/vendor/github.com/emicklei/go-restful/curly.go index ce284f747..185300dbc 100644 --- a/vendor/github.com/emicklei/go-restful/curly.go +++ b/vendor/github.com/emicklei/go-restful/curly.go @@ -44,16 +44,16 @@ func (c CurlyRouter) SelectRoute( } // selectRoutes return a collection of Route from a WebService that matches the path tokens from the request. -func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) []Route { - candidates := &sortableCurlyRoutes{[]*curlyRoute{}} +func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes { + candidates := sortableCurlyRoutes{} for _, each := range ws.routes { matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens) if matches { - candidates.add(&curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers? + candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers? } } sort.Sort(sort.Reverse(candidates)) - return candidates.routes() + return candidates } // matchesRouteByPathTokens computes whether it matches, howmany parameters do match and what the number of static path elements are. @@ -110,9 +110,9 @@ func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, reque // detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type // headers of the Request. See also RouterJSR311 in jsr311.go -func (c CurlyRouter) detectRoute(candidateRoutes []Route, httpRequest *http.Request) (*Route, error) { +func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpRequest *http.Request) (*Route, error) { // tracing is done inside detectRoute - return RouterJSR311{}.detectRoute(candidateRoutes, httpRequest) + return RouterJSR311{}.detectRoute(candidateRoutes.routes(), httpRequest) } // detectWebService returns the best matching webService given the list of path tokens. diff --git a/vendor/github.com/emicklei/go-restful/curly_route.go b/vendor/github.com/emicklei/go-restful/curly_route.go index 3edab72fd..296f94650 100644 --- a/vendor/github.com/emicklei/go-restful/curly_route.go +++ b/vendor/github.com/emicklei/go-restful/curly_route.go @@ -11,30 +11,28 @@ type curlyRoute struct { staticCount int } -type sortableCurlyRoutes struct { - candidates []*curlyRoute +type sortableCurlyRoutes []curlyRoute + +func (s *sortableCurlyRoutes) add(route curlyRoute) { + *s = append(*s, route) } -func (s *sortableCurlyRoutes) add(route *curlyRoute) { - s.candidates = append(s.candidates, route) -} - -func (s *sortableCurlyRoutes) routes() (routes []Route) { - for _, each := range s.candidates { +func (s sortableCurlyRoutes) routes() (routes []Route) { + for _, each := range s { routes = append(routes, each.route) // TODO change return type } return routes } -func (s *sortableCurlyRoutes) Len() int { - return len(s.candidates) +func (s sortableCurlyRoutes) Len() int { + return len(s) } -func (s *sortableCurlyRoutes) Swap(i, j int) { - s.candidates[i], s.candidates[j] = s.candidates[j], s.candidates[i] +func (s sortableCurlyRoutes) Swap(i, j int) { + s[i], s[j] = s[j], s[i] } -func (s *sortableCurlyRoutes) Less(i, j int) bool { - ci := s.candidates[i] - cj := s.candidates[j] +func (s sortableCurlyRoutes) Less(i, j int) bool { + ci := s[i] + cj := s[j] // primary key if ci.staticCount < cj.staticCount { diff --git a/vendor/github.com/emicklei/go-restful/jsr311.go b/vendor/github.com/emicklei/go-restful/jsr311.go index b4fa9bbae..511444ac6 100644 --- a/vendor/github.com/emicklei/go-restful/jsr311.go +++ b/vendor/github.com/emicklei/go-restful/jsr311.go @@ -74,7 +74,7 @@ func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*R // accept outputMediaOk := []Route{} accept := httpRequest.Header.Get(HEADER_Accept) - if accept == "" { + if len(accept) == 0 { accept = "*/*" } for _, each := range inputMediaOk { @@ -88,7 +88,8 @@ func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*R } return nil, NewError(http.StatusNotAcceptable, "406: Not Acceptable") } - return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil + // return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil + return &outputMediaOk[0], nil } // http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 diff --git a/vendor/github.com/emicklei/go-restful/response.go b/vendor/github.com/emicklei/go-restful/response.go index 696c67eb7..971cd0b42 100644 --- a/vendor/github.com/emicklei/go-restful/response.go +++ b/vendor/github.com/emicklei/go-restful/response.go @@ -130,25 +130,25 @@ func (r *Response) WriteHeaderAndEntity(status int, value interface{}) error { } // WriteAsXml is a convenience method for writing a value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the valuel ; not using a registered EntityReaderWriter. +// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. func (r *Response) WriteAsXml(value interface{}) error { return writeXML(r, http.StatusOK, MIME_XML, value) } // WriteHeaderAndXml is a convenience method for writing a status and value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the valuel ; not using a registered EntityReaderWriter. +// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. func (r *Response) WriteHeaderAndXml(status int, value interface{}) error { return writeXML(r, status, MIME_XML, value) } // WriteAsJson is a convenience method for writing a value in json. -// It uses the standard encoding/json package for marshalling the valuel ; not using a registered EntityReaderWriter. +// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. func (r *Response) WriteAsJson(value interface{}) error { return writeJSON(r, http.StatusOK, MIME_JSON, value) } // WriteJson is a convenience method for writing a value in Json with a given Content-Type. -// It uses the standard encoding/json package for marshalling the valuel ; not using a registered EntityReaderWriter. +// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. func (r *Response) WriteJson(value interface{}, contentType string) error { return writeJSON(r, http.StatusOK, contentType, value) } diff --git a/vendor/github.com/emicklei/go-restful/route_builder.go b/vendor/github.com/emicklei/go-restful/route_builder.go index b49b7c74d..8bc1ab684 100644 --- a/vendor/github.com/emicklei/go-restful/route_builder.go +++ b/vendor/github.com/emicklei/go-restful/route_builder.go @@ -128,7 +128,7 @@ func (b *RouteBuilder) Param(parameter *Parameter) *RouteBuilder { return b } -// Operation allows you to document what the acutal method/function call is of the Route. +// Operation allows you to document what the actual method/function call is of the Route. // Unless called, the operation name is derived from the RouteFunction set using To(..). func (b *RouteBuilder) Operation(name string) *RouteBuilder { b.operation = name diff --git a/vendor/github.com/emicklei/go-restful/swagger/config.go b/vendor/github.com/emicklei/go-restful/swagger/config.go index 944d988ee..510d6fc13 100644 --- a/vendor/github.com/emicklei/go-restful/swagger/config.go +++ b/vendor/github.com/emicklei/go-restful/swagger/config.go @@ -9,6 +9,8 @@ import ( // PostBuildDeclarationMapFunc can be used to modify the api declaration map. type PostBuildDeclarationMapFunc func(apiDeclarationMap *ApiDeclarationList) +type MapSchemaFormatFunc func(typeName string) string + type Config struct { // url where the services are available, e.g. http://localhost:8080 // if left empty then the basePath of Swagger is taken from the actual request @@ -31,4 +33,6 @@ type Config struct { PostBuildHandler PostBuildDeclarationMapFunc // Swagger global info struct Info Info + // [optional] If set, model builder should call this handler to get addition typename-to-swagger-format-field convertion. + SchemaFormatHandler MapSchemaFormatFunc } diff --git a/vendor/github.com/emicklei/go-restful/swagger/model_builder.go b/vendor/github.com/emicklei/go-restful/swagger/model_builder.go index fcc2976cb..696d192e5 100644 --- a/vendor/github.com/emicklei/go-restful/swagger/model_builder.go +++ b/vendor/github.com/emicklei/go-restful/swagger/model_builder.go @@ -14,6 +14,7 @@ type ModelBuildable interface { type modelBuilder struct { Models *ModelList + Config *Config } type documentable interface { @@ -231,7 +232,7 @@ func (b modelBuilder) buildStructTypeProperty(field reflect.StructField, jsonNam if field.Name == fieldType.Name() && field.Anonymous && !hasNamedJSONTag(field) { // embedded struct - sub := modelBuilder{new(ModelList)} + sub := modelBuilder{new(ModelList), b.Config} sub.addModel(fieldType, "") subKey := sub.keyFrom(fieldType) // merge properties from sub @@ -410,6 +411,11 @@ func (b modelBuilder) jsonSchemaType(modelName string) string { } func (b modelBuilder) jsonSchemaFormat(modelName string) string { + if b.Config != nil && b.Config.SchemaFormatHandler != nil { + if mapped := b.Config.SchemaFormatHandler(modelName); mapped != "" { + return mapped + } + } schemaMap := map[string]string{ "int": "int32", "int32": "int32", diff --git a/vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go b/vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go index 8dc3d5f9e..58dd62590 100644 --- a/vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go +++ b/vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go @@ -241,7 +241,7 @@ func (sws SwaggerService) composeDeclaration(ws *restful.WebService, pathPrefix DataTypeFields: DataTypeFields{Type: &voidString}, Parameters: []Parameter{}, Nickname: route.Operation, - ResponseMessages: composeResponseMessages(route, &decl)} + ResponseMessages: composeResponseMessages(route, &decl, &sws.config)} operation.Consumes = route.Consumes operation.Produces = route.Produces @@ -271,7 +271,7 @@ func withoutWildcard(path string) string { } // composeResponseMessages takes the ResponseErrors (if any) and creates ResponseMessages from them. -func composeResponseMessages(route restful.Route, decl *ApiDeclaration) (messages []ResponseMessage) { +func composeResponseMessages(route restful.Route, decl *ApiDeclaration, config *Config) (messages []ResponseMessage) { if route.ResponseErrors == nil { return messages } @@ -294,7 +294,7 @@ func composeResponseMessages(route restful.Route, decl *ApiDeclaration) (message if isCollection { modelName = "array[" + modelName + "]" } - modelBuilder{&decl.Models}.addModel(st, "") + modelBuilder{Models: &decl.Models, Config: config}.addModel(st, "") // reference the model message.ResponseModel = modelName } @@ -332,11 +332,11 @@ func detectCollectionType(st reflect.Type) (bool, reflect.Type) { // addModelFromSample creates and adds (or overwrites) a Model from a sample resource func (sws SwaggerService) addModelFromSampleTo(operation *Operation, isResponse bool, sample interface{}, models *ModelList) { if isResponse { - type_, items := asDataType(sample) + type_, items := asDataType(sample, &sws.config) operation.Type = type_ operation.Items = items } - modelBuilder{models}.addModelFrom(sample) + modelBuilder{Models: models, Config: &sws.config}.addModelFrom(sample) } func asSwaggerParameter(param restful.ParameterData) Parameter { @@ -411,7 +411,7 @@ func asParamType(kind int) string { return "" } -func asDataType(any interface{}) (*string, *Item) { +func asDataType(any interface{}, config *Config) (*string, *Item) { // If it's not a collection, return the suggested model name st := reflect.TypeOf(any) isCollection, st := detectCollectionType(st) @@ -424,7 +424,7 @@ func asDataType(any interface{}) (*string, *Item) { // XXX: This is not very elegant // We create an Item object referring to the given model models := ModelList{} - mb := modelBuilder{&models} + mb := modelBuilder{Models: &models, Config: config} mb.addModelFrom(any) elemTypeName := mb.getElementTypeName(modelName, "", st) diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go index c8f779656..274ab47dd 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go @@ -9,7 +9,7 @@ import ( ) type Manager interface { - // Apply cgroup configuration to the process with the specified pid + // Applies cgroup configuration to the process with the specified pid Apply(pid int) error // Returns the PIDs inside the cgroup set diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/apply_raw.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/apply_raw.go index 4da3b734e..633ab0427 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/apply_raw.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/apply_raw.go @@ -14,6 +14,7 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/configs" + libcontainerUtils "github.com/opencontainers/runc/libcontainer/utils" ) var ( @@ -30,6 +31,7 @@ var ( &NetPrioGroup{}, &PerfEventGroup{}, &FreezerGroup{}, + &NameGroup{GroupName: "name=systemd", Join: true}, } CgroupProcesses = "cgroup.procs" HugePageSizes, _ = cgroups.GetHugePageSize() @@ -94,11 +96,10 @@ func getCgroupRoot() (string, error) { } type cgroupData struct { - root string - parent string - name string - config *configs.Cgroup - pid int + root string + innerPath string + config *configs.Cgroup + pid int } func (m *Manager) Apply(pid int) (err error) { @@ -129,12 +130,9 @@ func (m *Manager) Apply(pid int) (err error) { return cgroups.EnterPid(m.Paths, pid) } + m.mu.Lock() + defer m.mu.Unlock() paths := make(map[string]string) - defer func() { - if err != nil { - cgroups.RemovePaths(paths) - } - }() for _, sys := range subsystems { if err := sys.Apply(d); err != nil { return err @@ -144,7 +142,9 @@ func (m *Manager) Apply(pid int) (err error) { // created then join consists of writing the process pids to cgroup.procs p, err := d.path(sys.Name()) if err != nil { - if cgroups.IsNotFound(err) { + // The non-presence of the devices subsystem is + // considered fatal for security reasons. + if cgroups.IsNotFound(err) && sys.Name() != "devices" { continue } return err @@ -267,45 +267,31 @@ func getCgroupPath(c *configs.Cgroup) (string, error) { return d.path("devices") } -// pathClean makes a path safe for use with filepath.Join. This is done by not -// only cleaning the path, but also (if the path is relative) adding a leading -// '/' and cleaning it (then removing the leading '/'). This ensures that a -// path resulting from prepending another path will always resolve to lexically -// be a subdirectory of the prefixed path. This is all done lexically, so paths -// that include symlinks won't be safe as a result of using pathClean. -func pathClean(path string) string { - // Ensure that all paths are cleaned (especially problematic ones like - // "/../../../../../" which can cause lots of issues). - path = filepath.Clean(path) - - // If the path isn't absolute, we need to do more processing to fix paths - // such as "../../../..//some/path". We also shouldn't convert absolute - // paths to relative ones. - if !filepath.IsAbs(path) { - path = filepath.Clean(string(os.PathSeparator) + path) - // This can't fail, as (by definition) all paths are relative to root. - path, _ = filepath.Rel(string(os.PathSeparator), path) - } - - // Clean the path again for good measure. - return filepath.Clean(path) -} - func getCgroupData(c *configs.Cgroup, pid int) (*cgroupData, error) { root, err := getCgroupRoot() if err != nil { return nil, err } - // Clean the parent slice path. - c.Parent = pathClean(c.Parent) + if (c.Name != "" || c.Parent != "") && c.Path != "" { + return nil, fmt.Errorf("cgroup: either Path or Name and Parent should be used") + } + + // XXX: Do not remove this code. Path safety is important! -- cyphar + cgPath := libcontainerUtils.CleanPath(c.Path) + cgParent := libcontainerUtils.CleanPath(c.Parent) + cgName := libcontainerUtils.CleanPath(c.Name) + + innerPath := cgPath + if innerPath == "" { + innerPath = filepath.Join(cgParent, cgName) + } return &cgroupData{ - root: root, - parent: c.Parent, - name: c.Name, - config: c, - pid: pid, + root: root, + innerPath: innerPath, + config: c, + pid: pid, }, nil } @@ -333,11 +319,10 @@ func (raw *cgroupData) path(subsystem string) (string, error) { return "", err } - cgPath := filepath.Join(raw.parent, raw.name) // If the cgroup name/path is absolute do not look relative to the cgroup of the init process. - if filepath.IsAbs(cgPath) { + if filepath.IsAbs(raw.innerPath) { // Sometimes subsystems can be mounted togethger as 'cpu,cpuacct'. - return filepath.Join(raw.root, filepath.Base(mnt), cgPath), nil + return filepath.Join(raw.root, filepath.Base(mnt), raw.innerPath), nil } parentPath, err := raw.parentPath(subsystem, mnt, root) @@ -345,7 +330,7 @@ func (raw *cgroupData) path(subsystem string) (string, error) { return "", err } - return filepath.Join(parentPath, cgPath), nil + return filepath.Join(parentPath, raw.innerPath), nil } func (raw *cgroupData) join(subsystem string) (string, error) { @@ -366,9 +351,12 @@ func writeFile(dir, file, data string) error { // Normally dir should not be empty, one case is that cgroup subsystem // is not mounted, we will get empty dir, and we want it fail here. if dir == "" { - return fmt.Errorf("no such directory for %s.", file) + return fmt.Errorf("no such directory for %s", file) } - return ioutil.WriteFile(filepath.Join(dir, file), []byte(data), 0700) + if err := ioutil.WriteFile(filepath.Join(dir, file), []byte(data), 0700); err != nil { + return fmt.Errorf("failed to write %v to %v: %v", data, file, err) + } + return nil } func readFile(dir, file string) (string, error) { diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go index ed1002316..cbe62bd98 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go @@ -12,6 +12,7 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/configs" + libcontainerUtils "github.com/opencontainers/runc/libcontainer/utils" ) type CpusetGroup struct { @@ -88,7 +89,7 @@ func (s *CpusetGroup) getSubsystemSettings(parent string) (cpus []byte, mems []b // it's parent. func (s *CpusetGroup) ensureParent(current, root string) error { parent := filepath.Dir(current) - if filepath.Clean(parent) == root { + if libcontainerUtils.CleanPath(parent) == root { return nil } // Avoid infinite recursion. diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go index a41ce801f..5f7833109 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go @@ -5,6 +5,7 @@ package fs import ( "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/system" ) type DevicesGroup struct { @@ -25,6 +26,23 @@ func (s *DevicesGroup) Apply(d *cgroupData) error { } func (s *DevicesGroup) Set(path string, cgroup *configs.Cgroup) error { + if system.RunningInUserNS() { + return nil + } + + devices := cgroup.Resources.Devices + if len(devices) > 0 { + for _, dev := range devices { + file := "devices.deny" + if dev.Allow { + file = "devices.allow" + } + if err := writeFile(path, file, dev.CgroupString()); err != nil { + return err + } + } + return nil + } if !cgroup.Resources.AllowAllDevices { if err := writeFile(path, "devices.deny", "a"); err != nil { return err diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go index 8c3e963fe..b83712829 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go @@ -9,6 +9,7 @@ import ( "path/filepath" "strconv" "strings" + "time" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/configs" @@ -26,38 +27,75 @@ func (s *MemoryGroup) Apply(d *cgroupData) (err error) { if err != nil && !cgroups.IsNotFound(err) { return err } - if memoryAssigned(d.config) { - if path != "" { - if err := os.MkdirAll(path, 0755); err != nil { - return err - } - } - // We have to set kernel memory here, as we can't change it once - // processes have been attached. - if err := s.SetKernelMemory(path, d.config); err != nil { - return err - } + // reset error. + err = nil + if path == "" { + // Invalid input. + return fmt.Errorf("invalid path for memory cgroups: %+v", d) } - defer func() { if err != nil { os.RemoveAll(path) } }() - + if !cgroups.PathExists(path) { + if err = os.MkdirAll(path, 0755); err != nil { + return err + } + } + if memoryAssigned(d.config) { + // We have to set kernel memory here, as we can't change it once + // processes have been attached to the cgroup. + if err = s.SetKernelMemory(path, d.config); err != nil { + return err + } + } // We need to join memory cgroup after set memory limits, because // kmem.limit_in_bytes can only be set when the cgroup is empty. - _, err = d.join("memory") - if err != nil && !cgroups.IsNotFound(err) { + if _, jerr := d.join("memory"); jerr != nil && !cgroups.IsNotFound(jerr) { + err = jerr return err } return nil } +func getModifyTime(path string) (time.Time, error) { + stat, err := os.Stat(path) + if err != nil { + return time.Time{}, fmt.Errorf("failed to get memory cgroups creation time: %v", err) + } + return stat.ModTime(), nil +} + func (s *MemoryGroup) SetKernelMemory(path string, cgroup *configs.Cgroup) error { - // This has to be done separately because it has special constraints (it - // can't be done after there are processes attached to the cgroup). - if cgroup.Resources.KernelMemory > 0 { + // This has to be done separately because it has special + // constraints (it can only be initialized before setting up a + // hierarchy or adding a task to the cgroups. However, if + // sucessfully initialized, it can be updated anytime afterwards) + if cgroup.Resources.KernelMemory != 0 { + // Is kmem.limit_in_bytes already set? + // memory.kmem.max_usage_in_bytes is a read-only file. Use it to get cgroups creation time. + kmemCreationTime, err := getModifyTime(filepath.Join(path, "memory.kmem.max_usage_in_bytes")) + if err != nil { + return err + } + kmemLimitsUpdateTime, err := getModifyTime(filepath.Join(path, "memory.kmem.limit_in_bytes")) + if err != nil { + return err + } + // kmem.limit_in_bytes has already been set if its update time is after that of creation time. + // We use `!=` op instead of `>` because updates are losing precision compared to creation. + kmemInitialized := !kmemLimitsUpdateTime.Equal(kmemCreationTime) + if !kmemInitialized { + // If there's already tasks in the cgroup, we can't change the limit either + tasks, err := getCgroupParamString(path, "tasks") + if err != nil { + return err + } + if tasks != "" { + return fmt.Errorf("cannot set kmem.limit_in_bytes after task have joined this cgroup") + } + } if err := writeFile(path, "memory.kmem.limit_in_bytes", strconv.FormatInt(cgroup.Resources.KernelMemory, 10)); err != nil { return err } @@ -65,19 +103,65 @@ func (s *MemoryGroup) SetKernelMemory(path string, cgroup *configs.Cgroup) error return nil } -func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error { - if cgroup.Resources.Memory != 0 { - if err := writeFile(path, "memory.limit_in_bytes", strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil { +func setMemoryAndSwap(path string, cgroup *configs.Cgroup) error { + // When memory and swap memory are both set, we need to handle the cases + // for updating container. + if cgroup.Resources.Memory != 0 && cgroup.Resources.MemorySwap > 0 { + memoryUsage, err := getMemoryData(path, "") + if err != nil { return err } + + // When update memory limit, we should adapt the write sequence + // for memory and swap memory, so it won't fail because the new + // value and the old value don't fit kernel's validation. + if memoryUsage.Limit < uint64(cgroup.Resources.MemorySwap) { + if err := writeFile(path, "memory.memsw.limit_in_bytes", strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil { + return err + } + if err := writeFile(path, "memory.limit_in_bytes", strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil { + return err + } + } else { + if err := writeFile(path, "memory.limit_in_bytes", strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil { + return err + } + if err := writeFile(path, "memory.memsw.limit_in_bytes", strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil { + return err + } + } + } else { + if cgroup.Resources.Memory != 0 { + if err := writeFile(path, "memory.limit_in_bytes", strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil { + return err + } + } + if cgroup.Resources.MemorySwap > 0 { + if err := writeFile(path, "memory.memsw.limit_in_bytes", strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil { + return err + } + } } + + return nil +} + +func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error { + if err := setMemoryAndSwap(path, cgroup); err != nil { + return err + } + + if err := s.SetKernelMemory(path, cgroup); err != nil { + return err + } + if cgroup.Resources.MemoryReservation != 0 { if err := writeFile(path, "memory.soft_limit_in_bytes", strconv.FormatInt(cgroup.Resources.MemoryReservation, 10)); err != nil { return err } } - if cgroup.Resources.MemorySwap > 0 { - if err := writeFile(path, "memory.memsw.limit_in_bytes", strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil { + if cgroup.Resources.KernelMemoryTCP != 0 { + if err := writeFile(path, "memory.kmem.tcp.limit_in_bytes", strconv.FormatInt(cgroup.Resources.KernelMemoryTCP, 10)); err != nil { return err } } @@ -86,14 +170,14 @@ func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error { return err } } - if cgroup.Resources.MemorySwappiness >= 0 && cgroup.Resources.MemorySwappiness <= 100 { - if err := writeFile(path, "memory.swappiness", strconv.FormatInt(cgroup.Resources.MemorySwappiness, 10)); err != nil { + if cgroup.Resources.MemorySwappiness == nil || int64(*cgroup.Resources.MemorySwappiness) == -1 { + return nil + } else if int64(*cgroup.Resources.MemorySwappiness) >= 0 && int64(*cgroup.Resources.MemorySwappiness) <= 100 { + if err := writeFile(path, "memory.swappiness", strconv.FormatInt(*cgroup.Resources.MemorySwappiness, 10)); err != nil { return err } - } else if cgroup.Resources.MemorySwappiness == -1 { - return nil } else { - return fmt.Errorf("invalid value:%d. valid memory swappiness range is 0-100", cgroup.Resources.MemorySwappiness) + return fmt.Errorf("invalid value:%d. valid memory swappiness range is 0-100", int64(*cgroup.Resources.MemorySwappiness)) } return nil @@ -139,6 +223,11 @@ func (s *MemoryGroup) GetStats(path string, stats *cgroups.Stats) error { return err } stats.MemoryStats.KernelUsage = kernelUsage + kernelTCPUsage, err := getMemoryData(path, "kmem.tcp") + if err != nil { + return err + } + stats.MemoryStats.KernelTCPUsage = kernelTCPUsage return nil } @@ -148,8 +237,9 @@ func memoryAssigned(cgroup *configs.Cgroup) bool { cgroup.Resources.MemoryReservation != 0 || cgroup.Resources.MemorySwap > 0 || cgroup.Resources.KernelMemory > 0 || + cgroup.Resources.KernelMemoryTCP > 0 || cgroup.Resources.OomKillDisable || - cgroup.Resources.MemorySwappiness != -1 + (cgroup.Resources.MemorySwappiness != nil && *cgroup.Resources.MemorySwappiness != -1) } func getMemoryData(path, name string) (cgroups.MemoryData, error) { @@ -162,6 +252,7 @@ func getMemoryData(path, name string) (cgroups.MemoryData, error) { usage := strings.Join([]string{moduleName, "usage_in_bytes"}, ".") maxUsage := strings.Join([]string{moduleName, "max_usage_in_bytes"}, ".") failcnt := strings.Join([]string{moduleName, "failcnt"}, ".") + limit := strings.Join([]string{moduleName, "limit_in_bytes"}, ".") value, err := getCgroupParamUint(path, usage) if err != nil { @@ -187,6 +278,14 @@ func getMemoryData(path, name string) (cgroups.MemoryData, error) { return cgroups.MemoryData{}, fmt.Errorf("failed to parse %s - %v", failcnt, err) } memoryData.Failcnt = value + value, err = getCgroupParamUint(path, limit) + if err != nil { + if moduleName != "memory" && os.IsNotExist(err) { + return cgroups.MemoryData{}, nil + } + return cgroups.MemoryData{}, fmt.Errorf("failed to parse %s - %v", limit, err) + } + memoryData.Limit = value return memoryData, nil } diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go index 0e423f667..d8cf1d87c 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go @@ -9,6 +9,7 @@ import ( type NameGroup struct { GroupName string + Join bool } func (s *NameGroup) Name() string { @@ -16,6 +17,10 @@ func (s *NameGroup) Name() string { } func (s *NameGroup) Apply(d *cgroupData) error { + if s.Join { + // ignore errors if the named cgroup does not exist + d.join(s.GroupName) + } return nil } @@ -24,6 +29,9 @@ func (s *NameGroup) Set(path string, cgroup *configs.Cgroup) error { } func (s *NameGroup) Remove(d *cgroupData) error { + if s.Join { + removePath(d.path(s.GroupName)) + } return nil } diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go index 96cbb896c..f1e372055 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go @@ -4,6 +4,7 @@ package fs import ( "fmt" + "path/filepath" "strconv" "github.com/opencontainers/runc/libcontainer/cgroups" @@ -47,11 +48,26 @@ func (s *PidsGroup) Remove(d *cgroupData) error { } func (s *PidsGroup) GetStats(path string, stats *cgroups.Stats) error { - value, err := getCgroupParamUint(path, "pids.current") + current, err := getCgroupParamUint(path, "pids.current") if err != nil { return fmt.Errorf("failed to parse pids.current - %s", err) } - stats.PidsStats.Current = value + maxString, err := getCgroupParamString(path, "pids.max") + if err != nil { + return fmt.Errorf("failed to parse pids.max - %s", err) + } + + // Default if pids.max == "max" is 0 -- which represents "no limit". + var max uint64 + if maxString != "max" { + max, err = parseUint(maxString, 10, 64) + if err != nil { + return fmt.Errorf("failed to parse pids.max - unable to parse %q as a uint from Cgroup file %q", maxString, filepath.Join(path, "pids.max")) + } + } + + stats.PidsStats.Current = current + stats.PidsStats.Limit = max return nil } diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/utils.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/utils.go index 852b18391..5ff0a1615 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/utils.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/utils.go @@ -12,7 +12,6 @@ import ( ) var ( - ErrNotSupportStat = errors.New("stats are not supported for subsystem") ErrNotValidFormat = errors.New("line is not a valid key value format") ) diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go index 74c65abf1..b483f1bf9 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go @@ -11,6 +11,7 @@ type ThrottlingData struct { ThrottledTime uint64 `json:"throttled_time,omitempty"` } +// CpuUsage denotes the usage of a CPU. // All CPU stats are aggregate since container inception. type CpuUsage struct { // Total CPU time consumed. @@ -36,7 +37,9 @@ type MemoryData struct { Usage uint64 `json:"usage,omitempty"` MaxUsage uint64 `json:"max_usage,omitempty"` Failcnt uint64 `json:"failcnt"` + Limit uint64 `json:"limit"` } + type MemoryStats struct { // memory used for cache Cache uint64 `json:"cache,omitempty"` @@ -44,14 +47,19 @@ type MemoryStats struct { Usage MemoryData `json:"usage,omitempty"` // usage of memory + swap SwapUsage MemoryData `json:"swap_usage,omitempty"` - // usafe of kernel memory - KernelUsage MemoryData `json:"kernel_usage,omitempty"` - Stats map[string]uint64 `json:"stats,omitempty"` + // usage of kernel memory + KernelUsage MemoryData `json:"kernel_usage,omitempty"` + // usage of kernel TCP memory + KernelTCPUsage MemoryData `json:"kernel_tcp_usage,omitempty"` + + Stats map[string]uint64 `json:"stats,omitempty"` } type PidsStats struct { // number of pids in the cgroup Current uint64 `json:"current,omitempty"` + // active pids hard limit + Limit uint64 `json:"limit,omitempty"` } type BlkioStatEntry struct { @@ -78,7 +86,7 @@ type HugetlbStats struct { Usage uint64 `json:"usage,omitempty"` // maximum usage ever recorded. MaxUsage uint64 `json:"max_usage,omitempty"` - // number of times htgetlb usage allocation failure. + // number of times hugetlb usage allocation failure. Failcnt uint64 `json:"failcnt"` } diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go index 88620aaee..1a7c4e1a0 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go @@ -5,6 +5,7 @@ package cgroups import ( "bufio" "fmt" + "io" "io/ioutil" "os" "path/filepath" @@ -12,17 +13,19 @@ import ( "strings" "time" - "github.com/docker/docker/pkg/mount" "github.com/docker/go-units" ) const cgroupNamePrefix = "name=" -// https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt +// https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt func FindCgroupMountpoint(subsystem string) (string, error) { // We are not using mount.GetMounts() because it's super-inefficient, // parsing it directly sped up x10 times because of not using Sscanf. // It was one of two major performance drawbacks in container start. + if !isSubsystemAvailable(subsystem) { + return "", NewNotFoundError(subsystem) + } f, err := os.Open("/proc/self/mountinfo") if err != nil { return "", err @@ -47,6 +50,9 @@ func FindCgroupMountpoint(subsystem string) (string, error) { } func FindCgroupMountpointAndRoot(subsystem string) (string, string, error) { + if !isSubsystemAvailable(subsystem) { + return "", "", NewNotFoundError(subsystem) + } f, err := os.Open("/proc/self/mountinfo") if err != nil { return "", "", err @@ -70,6 +76,15 @@ func FindCgroupMountpointAndRoot(subsystem string) (string, string, error) { return "", "", NewNotFoundError(subsystem) } +func isSubsystemAvailable(subsystem string) bool { + cgroups, err := ParseCgroupFile("/proc/self/cgroup") + if err != nil { + return false + } + _, avail := cgroups[subsystem] + return avail +} + func FindCgroupMountpointDir() (string, error) { f, err := os.Open("/proc/self/mountinfo") if err != nil { @@ -121,42 +136,63 @@ func (m Mount) GetThisCgroupDir(cgroups map[string]string) (string, error) { return getControllerPath(m.Subsystems[0], cgroups) } +func getCgroupMountsHelper(ss map[string]bool, mi io.Reader) ([]Mount, error) { + res := make([]Mount, 0, len(ss)) + scanner := bufio.NewScanner(mi) + numFound := 0 + for scanner.Scan() && numFound < len(ss) { + txt := scanner.Text() + sepIdx := strings.Index(txt, " - ") + if sepIdx == -1 { + return nil, fmt.Errorf("invalid mountinfo format") + } + if txt[sepIdx+3:sepIdx+9] != "cgroup" { + continue + } + fields := strings.Split(txt, " ") + m := Mount{ + Mountpoint: fields[4], + Root: fields[3], + } + for _, opt := range strings.Split(fields[len(fields)-1], ",") { + if !ss[opt] { + continue + } + if strings.HasPrefix(opt, cgroupNamePrefix) { + m.Subsystems = append(m.Subsystems, opt[len(cgroupNamePrefix):]) + } else { + m.Subsystems = append(m.Subsystems, opt) + } + numFound++ + } + res = append(res, m) + } + if err := scanner.Err(); err != nil { + return nil, err + } + return res, nil +} + func GetCgroupMounts() ([]Mount, error) { - mounts, err := mount.GetMounts() + f, err := os.Open("/proc/self/mountinfo") if err != nil { return nil, err } + defer f.Close() - all, err := GetAllSubsystems() + all, err := ParseCgroupFile("/proc/self/cgroup") if err != nil { return nil, err } allMap := make(map[string]bool) - for _, s := range all { + for s := range all { allMap[s] = true } - - res := []Mount{} - for _, mount := range mounts { - if mount.Fstype == "cgroup" { - m := Mount{Mountpoint: mount.Mountpoint, Root: mount.Root} - - for _, opt := range strings.Split(mount.VfsOpts, ",") { - if strings.HasPrefix(opt, cgroupNamePrefix) { - m.Subsystems = append(m.Subsystems, opt[len(cgroupNamePrefix):]) - } - if allMap[opt] { - m.Subsystems = append(m.Subsystems, opt) - } - } - res = append(res, m) - } - } - return res, nil + return getCgroupMountsHelper(allMap, f) } -// Returns all the cgroup subsystems supported by the kernel +// GetAllSubsystems returns all the cgroup subsystems supported by the kernel func GetAllSubsystems() ([]string, error) { f, err := os.Open("/proc/cgroups") if err != nil { @@ -182,7 +218,7 @@ func GetAllSubsystems() ([]string, error) { return subsystems, nil } -// Returns the relative path to the cgroup docker is running in. +// GetThisCgroupDir returns the relative path to the cgroup docker is running in. func GetThisCgroupDir(subsystem string) (string, error) { cgroups, err := ParseCgroupFile("/proc/self/cgroup") if err != nil { @@ -226,6 +262,8 @@ func readProcsFile(dir string) ([]int, error) { return out, nil } +// ParseCgroupFile parses the given cgroup file, typically from +// /proc//cgroup, into a map of subgroups to cgroup names. func ParseCgroupFile(path string) (map[string]string, error) { f, err := os.Open(path) if err != nil { @@ -233,7 +271,12 @@ func ParseCgroupFile(path string) (map[string]string, error) { } defer f.Close() - s := bufio.NewScanner(f) + return parseCgroupFromReader(f) +} + +// helper function for ParseCgroupFile to make testing easier +func parseCgroupFromReader(r io.Reader) (map[string]string, error) { + s := bufio.NewScanner(r) cgroups := make(map[string]string) for s.Scan() { @@ -242,7 +285,16 @@ func ParseCgroupFile(path string) (map[string]string, error) { } text := s.Text() - parts := strings.Split(text, ":") + // from cgroups(7): + // /proc/[pid]/cgroup + // ... + // For each cgroup hierarchy ... there is one entry + // containing three colon-separated fields of the form: + // hierarchy-ID:subsystem-list:cgroup-path + parts := strings.SplitN(text, ":", 3) + if len(parts) < 3 { + return nil, fmt.Errorf("invalid cgroup entry: must contain at least two colons: %v", text) + } for _, subs := range strings.Split(parts[1], ",") { cgroups[subs] = parts[2] @@ -309,7 +361,7 @@ func RemovePaths(paths map[string]string) (err error) { return nil } } - return fmt.Errorf("Failed to remove paths: %s", paths) + return fmt.Errorf("Failed to remove paths: %v", paths) } func GetHugePageSize() ([]string, error) { diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_unix.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_unix.go index c186d289a..f2eff91cf 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_unix.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_unix.go @@ -11,15 +11,22 @@ const ( ) type Cgroup struct { - Name string `json:"name"` + // Deprecated, use Path instead + Name string `json:"name,omitempty"` - // name of parent cgroup or slice - Parent string `json:"parent"` + // name of parent of cgroup or slice + // Deprecated, use Path instead + Parent string `json:"parent,omitempty"` + + // Path specifies the path to cgroups that are created and/or joined by the container. + // The path is assumed to be relative to the host system cgroup mountpoint. + Path string `json:"path"` // ScopePrefix decribes prefix for the scope name ScopePrefix string `json:"scope_prefix"` - // Paths represent the cgroups paths to join + // Paths represent the absolute cgroups paths to join. + // This takes precedence over Path. Paths map[string]string // Resources contains various cgroups settings to apply @@ -28,11 +35,14 @@ type Cgroup struct { type Resources struct { // If this is true allow access to any kind of device within the container. If false, allow access only to devices explicitly listed in the allowed_devices list. - AllowAllDevices bool `json:"allow_all_devices"` + // Deprecated + AllowAllDevices bool `json:"allow_all_devices,omitempty"` + // Deprecated + AllowedDevices []*Device `json:"allowed_devices,omitempty"` + // Deprecated + DeniedDevices []*Device `json:"denied_devices,omitempty"` - AllowedDevices []*Device `json:"allowed_devices"` - - DeniedDevices []*Device `json:"denied_devices"` + Devices []*Device `json:"devices"` // Memory limit (in bytes) Memory int64 `json:"memory"` @@ -46,6 +56,9 @@ type Resources struct { // Kernel memory limit (in bytes) KernelMemory int64 `json:"kernel_memory"` + // Kernel memory limit for TCP use (in bytes) + KernelMemoryTCP int64 `json:"kernel_memory_tcp"` + // CPU shares (relative weight vs. other containers) CpuShares int64 `json:"cpu_shares"` @@ -101,7 +114,7 @@ type Resources struct { OomKillDisable bool `json:"oom_kill_disable"` // Tuning swappiness behaviour per cgroup - MemorySwappiness int64 `json:"memory_swappiness"` + MemorySwappiness *int64 `json:"memory_swappiness"` // Set priority of network traffic for container NetPrioIfpriomap []*IfPrioMap `json:"net_prio_ifpriomap"` diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go index 069daae29..806e0be96 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go @@ -3,7 +3,11 @@ package configs import ( "bytes" "encoding/json" + "fmt" "os/exec" + "time" + + "github.com/Sirupsen/logrus" ) type Rlimit struct { @@ -29,7 +33,7 @@ type Seccomp struct { Syscalls []*Syscall `json:"syscalls"` } -// An action to be taken upon rule match in Seccomp +// Action is taken upon rule match in Seccomp type Action int const ( @@ -40,7 +44,7 @@ const ( Trace ) -// A comparison operator to be used when matching syscall arguments in Seccomp +// Operator is a comparison operator to be used when matching syscall arguments in Seccomp type Operator int const ( @@ -53,7 +57,7 @@ const ( MaskEqualTo ) -// A rule to match a specific syscall argument in Seccomp +// Arg is a rule to match a specific syscall argument in Seccomp type Arg struct { Index uint `json:"index"` Value uint64 `json:"value"` @@ -61,7 +65,7 @@ type Arg struct { Op Operator `json:"op"` } -// An rule to match a syscall in Seccomp +// Syscall is a rule to match a syscall in Seccomp type Syscall struct { Name string `json:"name"` Action Action `json:"action"` @@ -128,15 +132,15 @@ type Config struct { // AppArmorProfile specifies the profile to apply to the process running in the container and is // change at the time the process is execed - AppArmorProfile string `json:"apparmor_profile"` + AppArmorProfile string `json:"apparmor_profile,omitempty"` // ProcessLabel specifies the label to apply to the process running in the container. It is // commonly used by selinux - ProcessLabel string `json:"process_label"` + ProcessLabel string `json:"process_label,omitempty"` // Rlimits specifies the resource limits, such as max open files, to set in the container // If Rlimits are not set, the container will inherit rlimits from the parent process - Rlimits []Rlimit `json:"rlimits"` + Rlimits []Rlimit `json:"rlimits,omitempty"` // OomScoreAdj specifies the adjustment to be made by the kernel when calculating oom scores // for a process. Valid values are between the range [-1000, '1000'], where processes with @@ -171,12 +175,22 @@ type Config struct { // A default action to be taken if no rules match is also given. Seccomp *Seccomp `json:"seccomp"` + // NoNewPrivileges controls whether processes in the container can gain additional privileges. + NoNewPrivileges bool `json:"no_new_privileges,omitempty"` + // Hooks are a collection of actions to perform at various container lifecycle events. - // Hooks are not able to be marshaled to json but they are also not needed to. - Hooks *Hooks `json:"-"` + // CommandHooks are serialized to JSON, but other hooks are not. + Hooks *Hooks // Version is the version of opencontainer specification that is supported. Version string `json:"version"` + + // Labels are user defined metadata that is stored in the config and populated on the state + Labels []string `json:"labels"` + + // NoNewKeyring will not allocated a new session keyring for the container. It will use the + // callers keyring in this case. + NoNewKeyring bool `json:"no_new_keyring"` } type Hooks struct { @@ -191,12 +205,59 @@ type Hooks struct { Poststop []Hook } +func (hooks *Hooks) UnmarshalJSON(b []byte) error { + var state struct { + Prestart []CommandHook + Poststart []CommandHook + Poststop []CommandHook + } + + if err := json.Unmarshal(b, &state); err != nil { + return err + } + + deserialize := func(shooks []CommandHook) (hooks []Hook) { + for _, shook := range shooks { + hooks = append(hooks, shook) + } + + return hooks + } + + hooks.Prestart = deserialize(state.Prestart) + hooks.Poststart = deserialize(state.Poststart) + hooks.Poststop = deserialize(state.Poststop) + return nil +} + +func (hooks Hooks) MarshalJSON() ([]byte, error) { + serialize := func(hooks []Hook) (serializableHooks []CommandHook) { + for _, hook := range hooks { + switch chook := hook.(type) { + case CommandHook: + serializableHooks = append(serializableHooks, chook) + default: + logrus.Warnf("cannot serialize hook of type %T, skipping", hook) + } + } + + return serializableHooks + } + + return json.Marshal(map[string]interface{}{ + "prestart": serialize(hooks.Prestart), + "poststart": serialize(hooks.Poststart), + "poststop": serialize(hooks.Poststop), + }) +} + // HookState is the payload provided to a hook on execution. type HookState struct { - Version string `json:"version"` - ID string `json:"id"` - Pid int `json:"pid"` - Root string `json:"root"` + Version string `json:"ociVersion"` + ID string `json:"id"` + Pid int `json:"pid"` + Root string `json:"root"` + BundlePath string `json:"bundlePath"` } type Hook interface { @@ -204,7 +265,7 @@ type Hook interface { Run(HookState) error } -// NewFunctionHooks will call the provided function when the hook is run. +// NewFunctionHook will call the provided function when the hook is run. func NewFunctionHook(f func(HookState) error) FuncHook { return FuncHook{ run: f, @@ -220,13 +281,14 @@ func (f FuncHook) Run(s HookState) error { } type Command struct { - Path string `json:"path"` - Args []string `json:"args"` - Env []string `json:"env"` - Dir string `json:"dir"` + Path string `json:"path"` + Args []string `json:"args"` + Env []string `json:"env"` + Dir string `json:"dir"` + Timeout *time.Duration `json:"timeout"` } -// NewCommandHooks will execute the provided command when the hook is run. +// NewCommandHook will execute the provided command when the hook is run. func NewCommandHook(cmd Command) CommandHook { return CommandHook{ Command: cmd, @@ -248,5 +310,23 @@ func (c Command) Run(s HookState) error { Env: c.Env, Stdin: bytes.NewReader(b), } - return cmd.Run() + errC := make(chan error, 1) + go func() { + out, err := cmd.CombinedOutput() + if err != nil { + err = fmt.Errorf("%s: %s", err, out) + } + errC <- err + }() + if c.Timeout != nil { + select { + case err := <-errC: + return err + case <-time.After(*c.Timeout): + cmd.Process.Kill() + cmd.Wait() + return fmt.Errorf("hook ran past specified timeout of %.1fs", c.Timeout.Seconds()) + } + } + return <-errC } diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/config_unix.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/config_unix.go index c447f3ef2..a60554a7b 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/config_unix.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/config_unix.go @@ -4,7 +4,7 @@ package configs import "fmt" -// Gets the root uid for the process on host which could be non-zero +// HostUID gets the root uid for the process on host which could be non-zero // when user namespaces are enabled. func (c Config) HostUID() (int, error) { if c.Namespaces.Contains(NEWUSER) { @@ -21,7 +21,7 @@ func (c Config) HostUID() (int, error) { return 0, nil } -// Gets the root gid for the process on host which could be non-zero +// HostGID gets the root gid for the process on host which could be non-zero // when user namespaces are enabled. func (c Config) HostGID() (int, error) { if c.Namespaces.Contains(NEWUSER) { diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/device.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/device.go index a52a024af..8701bb212 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/device.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/device.go @@ -35,6 +35,9 @@ type Device struct { // Gid of the device. Gid uint32 `json:"gid"` + + // Write the file to the allowed list + Allow bool `json:"allow"` } func (d *Device) CgroupString() string { diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/device_defaults.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/device_defaults.go index e45299264..ba1f437f3 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/device_defaults.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/device_defaults.go @@ -3,7 +3,7 @@ package configs var ( - // These are devices that are to be both allowed and created. + // DefaultSimpleDevices are devices that are to be both allowed and created. DefaultSimpleDevices = []*Device{ // /dev/null and zero { diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go index c962999ef..fb4b85222 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go @@ -18,7 +18,7 @@ var namespaceInfo = map[NamespaceType]int{ } // CloneFlags parses the container's Namespaces options to set the correct -// flags on clone, unshare. This functions returns flags only for new namespaces. +// flags on clone, unshare. This function returns flags only for new namespaces. func (n *Namespaces) CloneFlags() uintptr { var flag int for _, v := range *n { diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go index 1644588dc..0547223a9 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go @@ -8,7 +8,7 @@ func (n *Namespace) Syscall() int { } // CloneFlags parses the container's Namespaces options to set the correct -// flags on clone, unshare. This functions returns flags only for new namespaces. +// flags on clone, unshare. This function returns flags only for new namespaces. func (n *Namespaces) CloneFlags() uintptr { panic("No namespace syscall support") return uintptr(0) diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unix.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unix.go index 7bc908546..b9c820d06 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unix.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unix.go @@ -2,7 +2,11 @@ package configs -import "fmt" +import ( + "fmt" + "os" + "sync" +) const ( NEWNET NamespaceType = "NEWNET" @@ -13,6 +17,51 @@ const ( NEWUSER NamespaceType = "NEWUSER" ) +var ( + nsLock sync.Mutex + supportedNamespaces = make(map[NamespaceType]bool) +) + +// nsToFile converts the namespace type to its filename +func nsToFile(ns NamespaceType) string { + switch ns { + case NEWNET: + return "net" + case NEWNS: + return "mnt" + case NEWPID: + return "pid" + case NEWIPC: + return "ipc" + case NEWUSER: + return "user" + case NEWUTS: + return "uts" + } + return "" +} + +// IsNamespaceSupported returns whether a namespace is available or +// not +func IsNamespaceSupported(ns NamespaceType) bool { + nsLock.Lock() + defer nsLock.Unlock() + supported, ok := supportedNamespaces[ns] + if ok { + return supported + } + nsFile := nsToFile(ns) + // if the namespace type is unknown, just return false + if nsFile == "" { + return false + } + _, err := os.Stat(fmt.Sprintf("/proc/self/ns/%s", nsFile)) + // a namespace is supported if it exists and we have permissions to read it + supported = err == nil + supportedNamespaces[ns] = supported + return supported +} + func NamespaceTypes() []NamespaceType { return []NamespaceType{ NEWNET, @@ -35,26 +84,7 @@ func (n *Namespace) GetPath(pid int) string { if n.Path != "" { return n.Path } - return fmt.Sprintf("/proc/%d/ns/%s", pid, n.file()) -} - -func (n *Namespace) file() string { - file := "" - switch n.Type { - case NEWNET: - file = "net" - case NEWNS: - file = "mnt" - case NEWPID: - file = "pid" - case NEWIPC: - file = "ipc" - case NEWUSER: - file = "user" - case NEWUTS: - file = "uts" - } - return file + return fmt.Sprintf("/proc/%d/ns/%s", pid, nsToFile(n.Type)) } func (n *Namespaces) Remove(t NamespaceType) bool { @@ -87,3 +117,11 @@ func (n *Namespaces) index(t NamespaceType) int { func (n *Namespaces) Contains(t NamespaceType) bool { return n.index(t) != -1 } + +func (n *Namespaces) PathOf(t NamespaceType) string { + i := n.index(t) + if i == -1 { + return "" + } + return (*n)[i].Path +} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go b/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go index 6c835e68e..1afc52b4b 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go @@ -11,6 +11,19 @@ import ( "unsafe" ) +// If arg2 is nonzero, set the "child subreaper" attribute of the +// calling process; if arg2 is zero, unset the attribute. When a +// process is marked as a child subreaper, all of the children +// that it creates, and their descendants, will be marked as +// having a subreaper. In effect, a subreaper fulfills the role +// of init(1) for its descendant processes. Upon termination of +// a process that is orphaned (i.e., its immediate parent has +// already terminated) and marked as having a subreaper, the +// nearest still living ancestor subreaper will receive a SIGCHLD +// signal and be able to wait(2) on the process to discover its +// termination status. +const PR_SET_CHILD_SUBREAPER = 36 + type ParentDeathSignal int func (p ParentDeathSignal) Restore() error { @@ -40,6 +53,14 @@ func Execv(cmd string, args []string, env []string) error { return syscall.Exec(name, args, env) } +func Prlimit(pid, resource int, limit syscall.Rlimit) error { + _, _, err := syscall.RawSyscall6(syscall.SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(&limit)), uintptr(unsafe.Pointer(&limit)), 0, 0) + if err != 0 { + return err + } + return nil +} + func SetParentDeathSignal(sig uintptr) error { if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 { return err @@ -79,17 +100,12 @@ func Setctty() error { return nil } -/* - * Detect whether we are currently running in a user namespace. - * Copied from github.com/lxc/lxd/shared/util.go - */ +// RunningInUserNS detects whether we are currently running in a user namespace. +// Copied from github.com/lxc/lxd/shared/util.go func RunningInUserNS() bool { file, err := os.Open("/proc/self/uid_map") if err != nil { - /* - * This kernel-provided file only exists if user namespaces are - * supported - */ + // This kernel-provided file only exists if user namespaces are supported return false } defer file.Close() @@ -112,3 +128,16 @@ func RunningInUserNS() bool { } return true } + +// SetSubreaper sets the value i as the subreaper setting for the calling process +func SetSubreaper(i int) error { + return Prctl(PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0) +} + +func Prctl(option int, arg2, arg3, arg4, arg5 uintptr) (err error) { + _, _, e1 := syscall.Syscall6(syscall.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0) + if e1 != 0 { + err = e1 + } + return +} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go b/vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go new file mode 100644 index 000000000..e7cfd62b2 --- /dev/null +++ b/vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go @@ -0,0 +1,9 @@ +// +build !linux + +package system + +// RunningInUserNS is a stub for non-Linux systems +// Always returns false +func RunningInUserNS() bool { + return false +} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go b/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go new file mode 100644 index 000000000..3466bfcea --- /dev/null +++ b/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go @@ -0,0 +1,121 @@ +package utils + +import ( + "crypto/rand" + "encoding/hex" + "encoding/json" + "io" + "os" + "path/filepath" + "strings" + "syscall" +) + +const ( + exitSignalOffset = 128 +) + +// GenerateRandomName returns a new name joined with a prefix. This size +// specified is used to truncate the randomly generated value +func GenerateRandomName(prefix string, size int) (string, error) { + id := make([]byte, 32) + if _, err := io.ReadFull(rand.Reader, id); err != nil { + return "", err + } + if size > 64 { + size = 64 + } + return prefix + hex.EncodeToString(id)[:size], nil +} + +// ResolveRootfs ensures that the current working directory is +// not a symlink and returns the absolute path to the rootfs +func ResolveRootfs(uncleanRootfs string) (string, error) { + rootfs, err := filepath.Abs(uncleanRootfs) + if err != nil { + return "", err + } + return filepath.EvalSymlinks(rootfs) +} + +// ExitStatus returns the correct exit status for a process based on if it +// was signaled or exited cleanly +func ExitStatus(status syscall.WaitStatus) int { + if status.Signaled() { + return exitSignalOffset + int(status.Signal()) + } + return status.ExitStatus() +} + +// WriteJSON writes the provided struct v to w using standard json marshaling +func WriteJSON(w io.Writer, v interface{}) error { + data, err := json.Marshal(v) + if err != nil { + return err + } + _, err = w.Write(data) + return err +} + +// CleanPath makes a path safe for use with filepath.Join. This is done by not +// only cleaning the path, but also (if the path is relative) adding a leading +// '/' and cleaning it (then removing the leading '/'). This ensures that a +// path resulting from prepending another path will always resolve to lexically +// be a subdirectory of the prefixed path. This is all done lexically, so paths +// that include symlinks won't be safe as a result of using CleanPath. +func CleanPath(path string) string { + // Deal with empty strings nicely. + if path == "" { + return "" + } + + // Ensure that all paths are cleaned (especially problematic ones like + // "/../../../../../" which can cause lots of issues). + path = filepath.Clean(path) + + // If the path isn't absolute, we need to do more processing to fix paths + // such as "../../../..//some/path". We also shouldn't convert absolute + // paths to relative ones. + if !filepath.IsAbs(path) { + path = filepath.Clean(string(os.PathSeparator) + path) + // This can't fail, as (by definition) all paths are relative to root. + path, _ = filepath.Rel(string(os.PathSeparator), path) + } + + // Clean the path again for good measure. + return filepath.Clean(path) +} + +// SearchLabels searches a list of key-value pairs for the provided key and +// returns the corresponding value. The pairs must be separated with '='. +func SearchLabels(labels []string, query string) string { + for _, l := range labels { + parts := strings.SplitN(l, "=", 2) + if len(parts) < 2 { + continue + } + if parts[0] == query { + return parts[1] + } + } + return "" +} + +// Annotations returns the bundle path and user defined annotations from the +// libcontianer state. We need to remove the bundle because that is a label +// added by libcontainer. +func Annotations(labels []string) (bundle string, userAnnotations map[string]string) { + userAnnotations = make(map[string]string) + for _, l := range labels { + parts := strings.SplitN(l, "=", 2) + if len(parts) < 2 { + continue + } + if parts[0] == "bundle" { + bundle = parts[1] + } else { + userAnnotations[parts[0]] = parts[1] + } + } + return +} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go b/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go new file mode 100644 index 000000000..408918f27 --- /dev/null +++ b/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go @@ -0,0 +1,33 @@ +// +build !windows + +package utils + +import ( + "io/ioutil" + "strconv" + "syscall" +) + +func CloseExecFrom(minFd int) error { + fdList, err := ioutil.ReadDir("/proc/self/fd") + if err != nil { + return err + } + for _, fi := range fdList { + fd, err := strconv.Atoi(fi.Name()) + if err != nil { + // ignore non-numeric file names + continue + } + + if fd < minFd { + // ignore descriptors lower than our specified minimum + continue + } + + // intentionally ignore errors from syscall.CloseOnExec + syscall.CloseOnExec(fd) + // the cases where this might fail are basically file descriptors that have already been closed (including and especially the one that was created when ioutil.ReadDir did the "opendir" syscall) + } + return nil +} diff --git a/vendor/k8s.io/kubernetes/LICENSE b/vendor/k8s.io/kubernetes/LICENSE index 6b4d837a4..00b240110 100644 --- a/vendor/k8s.io/kubernetes/LICENSE +++ b/vendor/k8s.io/kubernetes/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2014 The Kubernetes Authors All rights reserved. + Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/deep_copy_generated.go b/vendor/k8s.io/kubernetes/federation/apis/federation/deep_copy_generated.go index e9936ff49..455839d8a 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,8 +22,6 @@ package federation import ( api "k8s.io/kubernetes/pkg/api" - resource "k8s.io/kubernetes/pkg/api/resource" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" ) @@ -32,7 +30,6 @@ func init() { DeepCopy_federation_Cluster, DeepCopy_federation_ClusterCondition, DeepCopy_federation_ClusterList, - DeepCopy_federation_ClusterMeta, DeepCopy_federation_ClusterSpec, DeepCopy_federation_ClusterStatus, DeepCopy_federation_ServerAddressByClientCIDR, @@ -43,9 +40,7 @@ func init() { } func DeepCopy_federation_Cluster(in Cluster, out *Cluster, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -61,24 +56,16 @@ func DeepCopy_federation_Cluster(in Cluster, out *Cluster, c *conversion.Cloner) func DeepCopy_federation_ClusterCondition(in ClusterCondition, out *ClusterCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_federation_ClusterList(in ClusterList, out *ClusterList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Cluster, len(in)) @@ -93,19 +80,12 @@ func DeepCopy_federation_ClusterList(in ClusterList, out *ClusterList, c *conver return nil } -func DeepCopy_federation_ClusterMeta(in ClusterMeta, out *ClusterMeta, c *conversion.Cloner) error { - out.Version = in.Version - return nil -} - func DeepCopy_federation_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversion.Cloner) error { if in.ServerAddressByClientCIDRs != nil { in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs *out = make([]ServerAddressByClientCIDR, len(in)) for i := range in { - if err := DeepCopy_federation_ServerAddressByClientCIDR(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.ServerAddressByClientCIDRs = nil @@ -113,9 +93,7 @@ func DeepCopy_federation_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conver if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(api.LocalObjectReference) - if err := api.DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretRef = nil } @@ -134,35 +112,6 @@ func DeepCopy_federation_ClusterStatus(in ClusterStatus, out *ClusterStatus, c * } else { out.Conditions = nil } - if in.Capacity != nil { - in, out := in.Capacity, &out.Capacity - *out = make(api.ResourceList) - for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Capacity = nil - } - if in.Allocatable != nil { - in, out := in.Allocatable, &out.Allocatable - *out = make(api.ResourceList) - for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Allocatable = nil - } - if err := DeepCopy_federation_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil { - return err - } if in.Zones != nil { in, out := in.Zones, &out.Zones *out = make([]string, len(in)) diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/doc.go b/vendor/k8s.io/kubernetes/federation/apis/federation/doc.go similarity index 84% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/doc.go rename to vendor/k8s.io/kubernetes/federation/apis/federation/doc.go index 65a03a209..7a45fb7bb 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/doc.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true -package v1alpha1 +// +k8s:deepcopy-gen=package,register + +package federation diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/install/install.go b/vendor/k8s.io/kubernetes/federation/apis/federation/install/install.go index 4c09c75d9..cedafe03a 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/install/install.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/apis/federation/v1alpha1" + "k8s.io/kubernetes/federation/apis/federation/v1beta1" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/unversioned" @@ -37,7 +37,7 @@ const importPrefix = "k8s.io/kubernetes/federation/apis/federation" var accessor = meta.NewAccessor() // availableVersions lists all known external versions for this group from most preferred to least preferred -var availableVersions = []unversioned.GroupVersion{v1alpha1.SchemeGroupVersion} +var availableVersions = []unversioned.GroupVersion{v1beta1.SchemeGroupVersion} func init() { registered.RegisterVersions(availableVersions) @@ -101,7 +101,7 @@ func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper // string, or an error if the version is not known. func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) { switch version { - case v1alpha1.SchemeGroupVersion: + case v1beta1.SchemeGroupVersion: return &meta.VersionInterfaces{ ObjectConvertor: api.Scheme, MetadataAccessor: accessor, @@ -122,8 +122,8 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) { continue } switch v { - case v1alpha1.SchemeGroupVersion: - v1alpha1.AddToScheme(api.Scheme) + case v1beta1.SchemeGroupVersion: + v1beta1.AddToScheme(api.Scheme) } } } diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/register.go b/vendor/k8s.io/kubernetes/federation/apis/federation/register.go index 2cc7f1f0e..ce906cb42 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/register.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/types.generated.go b/vendor/k8s.io/kubernetes/federation/apis/federation/types.generated.go index 483b5e8a4..af5e512e3 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/types.generated.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,9 +26,8 @@ import ( "fmt" codec1978 "github.com/ugorji/go/codec" pkg1_api "k8s.io/kubernetes/pkg/api" - pkg3_resource "k8s.io/kubernetes/pkg/api/resource" pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned" - pkg4_types "k8s.io/kubernetes/pkg/types" + pkg3_types "k8s.io/kubernetes/pkg/types" "reflect" "runtime" time "time" @@ -65,11 +64,10 @@ func init() { } if false { // reference the types, but skip this branch at build/run time var v0 pkg1_api.LocalObjectReference - var v1 pkg3_resource.Quantity - var v2 pkg2_unversioned.Time - var v3 pkg4_types.UID - var v4 time.Time - _, _, _, _, _ = v0, v1, v2, v3, v4 + var v1 pkg2_unversioned.Time + var v2 pkg3_types.UID + var v3 time.Time + _, _, _, _ = v0, v1, v2, v3 } } @@ -985,175 +983,6 @@ func (x *ClusterCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ClusterMeta) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - yyq2[0] = x.Version != "" - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 0 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("version")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterMeta) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap1234 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray1234 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterMeta) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3 { - case "version": - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterMeta) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj5 int - var yyb5 bool - var yyhl5 bool = l >= 0 - yyj5++ - if yyhl5 { - yyb5 = yyj5 > l - } else { - yyb5 = r.CheckBreak() - } - if yyb5 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } - for { - yyj5++ - if yyhl5 { - yyb5 = yyj5 > l - } else { - yyb5 = r.CheckBreak() - } - if yyb5 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj5-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -1168,18 +997,15 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool + var yyq2 [3]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false yyq2[0] = len(x.Conditions) != 0 - yyq2[1] = len(x.Capacity) != 0 - yyq2[2] = len(x.Allocatable) != 0 - yyq2[3] = len(x.Zones) != 0 - yyq2[4] = x.Region != "" - yyq2[5] = x.Version != "" + yyq2[1] = len(x.Zones) != 0 + yyq2[2] = x.Region != "" var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) + r.EncodeArrayStart(3) } else { yynn2 = 0 for _, b := range yyq2 { @@ -1226,79 +1052,29 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq2[1] { - if x.Capacity == nil { + if x.Zones == nil { r.EncodeNil() } else { - yysf7 := &x.Capacity - yysf7.CodecEncodeSelf(e) + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + z.F.EncSliceStringV(x.Zones, false, e) + } } } else { r.EncodeNil() } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("capacity")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Capacity == nil { - r.EncodeNil() - } else { - yysf8 := &x.Capacity - yysf8.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[2] { - if x.Allocatable == nil { - r.EncodeNil() - } else { - yysf10 := &x.Allocatable - yysf10.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("allocatable")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Allocatable == nil { - r.EncodeNil() - } else { - yysf11 := &x.Allocatable - yysf11.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[3] { - if x.Zones == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncSliceStringV(x.Zones, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("zones")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Zones == nil { r.EncodeNil() } else { - yym14 := z.EncBinary() - _ = yym14 + yym8 := z.EncBinary() + _ = yym8 if false { } else { z.F.EncSliceStringV(x.Zones, false, e) @@ -1308,9 +1084,9 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[4] { - yym16 := z.EncBinary() - _ = yym16 + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Region)) @@ -1319,43 +1095,18 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2[4] { + if yyq2[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("region")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym17 := z.EncBinary() - _ = yym17 + yym11 := z.EncBinary() + _ = yym11 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Region)) } } } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[5] { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("version")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } - } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -1429,30 +1180,16 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { h.decSliceClusterCondition((*[]ClusterCondition)(yyv4), d) } } - case "capacity": - if r.TryDecodeAsNil() { - x.Capacity = nil - } else { - yyv6 := &x.Capacity - yyv6.CodecDecodeSelf(d) - } - case "allocatable": - if r.TryDecodeAsNil() { - x.Allocatable = nil - } else { - yyv7 := &x.Allocatable - yyv7.CodecDecodeSelf(d) - } case "zones": if r.TryDecodeAsNil() { x.Zones = nil } else { - yyv8 := &x.Zones - yym9 := z.DecBinary() - _ = yym9 + yyv6 := &x.Zones + yym7 := z.DecBinary() + _ = yym7 if false { } else { - z.F.DecSliceStringX(yyv8, false, d) + z.F.DecSliceStringX(yyv6, false, d) } } case "region": @@ -1461,12 +1198,6 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Region = string(r.DecodeString()) } - case "version": - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 @@ -1478,16 +1209,16 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + var yyj9 int + var yyb9 bool + var yyhl9 bool = l >= 0 + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { + if yyb9 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1495,55 +1226,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv13 := &x.Conditions - yym14 := z.DecBinary() - _ = yym14 + yyv10 := &x.Conditions + yym11 := z.DecBinary() + _ = yym11 if false { } else { - h.decSliceClusterCondition((*[]ClusterCondition)(yyv13), d) + h.decSliceClusterCondition((*[]ClusterCondition)(yyv10), d) } } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Capacity = nil - } else { - yyv15 := &x.Capacity - yyv15.CodecDecodeSelf(d) - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Allocatable = nil - } else { - yyv16 := &x.Allocatable - yyv16.CodecDecodeSelf(d) - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { + if yyb9 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1551,21 +1248,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Zones = nil } else { - yyv17 := &x.Zones - yym18 := z.DecBinary() - _ = yym18 + yyv12 := &x.Zones + yym13 := z.DecBinary() + _ = yym13 if false { } else { - z.F.DecSliceStringX(yyv17, false, d) + z.F.DecSliceStringX(yyv12, false, d) } } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { + if yyb9 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1575,34 +1272,18 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Region = string(r.DecodeString()) } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { + if yyb9 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj12-1, "") + z.DecStructFieldNotFound(yyj9-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -2571,7 +2252,7 @@ func (x codecSelfer1234) decSliceCluster(v *[]Cluster, d *codec1978.Decoder) { yyrg1 := len(yyv1) > 0 yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368) + yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 336) if yyrt1 { if yyrl1 <= cap(yyv1) { yyv1 = yyv1[:yyrl1] diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/types.go b/vendor/k8s.io/kubernetes/federation/apis/federation/types.go index f8980823e..c3ee0eab8 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/types.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -71,21 +71,10 @@ type ClusterCondition struct { Message string `json:"message,omitempty"` } -// Cluster metadata -type ClusterMeta struct { - // Release version of the cluster. - Version string `json:"version,omitempty"` -} - // ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally. type ClusterStatus struct { // Conditions is an array of current cluster conditions. Conditions []ClusterCondition `json:"conditions,omitempty"` - // Capacity represents the total resources of the cluster - Capacity api.ResourceList `json:"capacity,omitempty"` - // Allocatable represents the total resources of a cluster that are available for scheduling. - Allocatable api.ResourceList `json:"allocatable,omitempty"` - ClusterMeta `json:",inline"` // Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. // These will always be in the same region. Zones []string `json:"zones,omitempty"` @@ -93,7 +82,8 @@ type ClusterStatus struct { Region string `json:"region,omitempty"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. type Cluster struct { diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/conversion_generated.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/conversion_generated.go deleted file mode 100644 index d09902d99..000000000 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/conversion_generated.go +++ /dev/null @@ -1,355 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2016 The Kubernetes Authors All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1alpha1 - -import ( - federation "k8s.io/kubernetes/federation/apis/federation" - api "k8s.io/kubernetes/pkg/api" - resource "k8s.io/kubernetes/pkg/api/resource" - v1 "k8s.io/kubernetes/pkg/api/v1" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_Cluster_To_federation_Cluster, - Convert_federation_Cluster_To_v1alpha1_Cluster, - Convert_v1alpha1_ClusterCondition_To_federation_ClusterCondition, - Convert_federation_ClusterCondition_To_v1alpha1_ClusterCondition, - Convert_v1alpha1_ClusterList_To_federation_ClusterList, - Convert_federation_ClusterList_To_v1alpha1_ClusterList, - Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta, - Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta, - Convert_v1alpha1_ClusterSpec_To_federation_ClusterSpec, - Convert_federation_ClusterSpec_To_v1alpha1_ClusterSpec, - Convert_v1alpha1_ClusterStatus_To_federation_ClusterStatus, - Convert_federation_ClusterStatus_To_v1alpha1_ClusterStatus, - Convert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR, - Convert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1alpha1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { - return autoConvert_v1alpha1_Cluster_To_federation_Cluster(in, out, s) -} - -func autoConvert_federation_Cluster_To_v1alpha1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_federation_Cluster_To_v1alpha1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { - return autoConvert_federation_Cluster_To_v1alpha1_Cluster(in, out, s) -} - -func autoConvert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - out.Type = federation.ClusterConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(in, out, s) -} - -func autoConvert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - out.Type = ClusterConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - return autoConvert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(in, out, s) -} - -func autoConvert_v1alpha1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil { - return err - } - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]federation.Cluster, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_Cluster_To_federation_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterList_To_federation_ClusterList(in, out, s) -} - -func autoConvert_federation_ClusterList_To_v1alpha1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil { - return err - } - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - if err := Convert_federation_Cluster_To_v1alpha1_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_federation_ClusterList_To_v1alpha1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { - return autoConvert_federation_ClusterList_To_v1alpha1_ClusterList(in, out, s) -} - -func autoConvert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(in *ClusterMeta, out *federation.ClusterMeta, s conversion.Scope) error { - out.Version = in.Version - return nil -} - -func Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(in *ClusterMeta, out *federation.ClusterMeta, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(in, out, s) -} - -func autoConvert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(in *federation.ClusterMeta, out *ClusterMeta, s conversion.Scope) error { - out.Version = in.Version - return nil -} - -func Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(in *federation.ClusterMeta, out *ClusterMeta, s conversion.Scope) error { - return autoConvert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(in, out, s) -} - -func autoConvert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]federation.ServerAddressByClientCIDR, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SecretRef = nil - } - return nil -} - -func Convert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(in, out, s) -} - -func autoConvert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(*in)) - for i := range *in { - if err := Convert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SecretRef = nil - } - return nil -} - -func Convert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - return autoConvert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(in, out, s) -} - -func autoConvert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]federation.ClusterCondition, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if err := v1.Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil { - return err - } - if err := v1.Convert_v1_ResourceList_To_api_ResourceList(&in.Allocatable, &out.Allocatable, s); err != nil { - return err - } - if err := Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil { - return err - } - out.Zones = in.Zones - out.Region = in.Region - return nil -} - -func Convert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(in, out, s) -} - -func autoConvert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - for i := range *in { - if err := Convert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(v1.ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[v1.ResourceName(key)] = *newVal - } - } else { - out.Capacity = nil - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(v1.ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[v1.ResourceName(key)] = *newVal - } - } else { - out.Allocatable = nil - } - if err := Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil { - return err - } - out.Zones = in.Zones - out.Region = in.Region - return nil -} - -func Convert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(in, out, s) -} - -func autoConvert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -func Convert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s) -} - -func autoConvert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -func Convert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(in, out, s) -} diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/deep_copy_generated.go deleted file mode 100644 index 52e672ccb..000000000 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/deep_copy_generated.go +++ /dev/null @@ -1,182 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2016 The Kubernetes Authors All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package v1alpha1 - -import ( - api "k8s.io/kubernetes/pkg/api" - resource "k8s.io/kubernetes/pkg/api/resource" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" - v1 "k8s.io/kubernetes/pkg/api/v1" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedDeepCopyFuncs( - DeepCopy_v1alpha1_Cluster, - DeepCopy_v1alpha1_ClusterCondition, - DeepCopy_v1alpha1_ClusterList, - DeepCopy_v1alpha1_ClusterMeta, - DeepCopy_v1alpha1_ClusterSpec, - DeepCopy_v1alpha1_ClusterStatus, - DeepCopy_v1alpha1_ServerAddressByClientCIDR, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_v1alpha1_Cluster(in Cluster, out *Cluster, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1alpha1_ClusterSpec(in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1alpha1_ClusterStatus(in.Status, &out.Status, c); err != nil { - return err - } - return nil -} - -func DeepCopy_v1alpha1_ClusterCondition(in ClusterCondition, out *ClusterCondition, c *conversion.Cloner) error { - out.Type = in.Type - out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func DeepCopy_v1alpha1_ClusterList(in ClusterList, out *ClusterList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } - if in.Items != nil { - in, out := in.Items, &out.Items - *out = make([]Cluster, len(in)) - for i := range in { - if err := DeepCopy_v1alpha1_Cluster(in[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func DeepCopy_v1alpha1_ClusterMeta(in ClusterMeta, out *ClusterMeta, c *conversion.Cloner) error { - out.Version = in.Version - return nil -} - -func DeepCopy_v1alpha1_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversion.Cloner) error { - if in.ServerAddressByClientCIDRs != nil { - in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(in)) - for i := range in { - if err := DeepCopy_v1alpha1_ServerAddressByClientCIDR(in[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - if err := v1.DeepCopy_v1_LocalObjectReference(*in, *out, c); err != nil { - return err - } - } else { - out.SecretRef = nil - } - return nil -} - -func DeepCopy_v1alpha1_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *conversion.Cloner) error { - if in.Conditions != nil { - in, out := in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(in)) - for i := range in { - if err := DeepCopy_v1alpha1_ClusterCondition(in[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Capacity != nil { - in, out := in.Capacity, &out.Capacity - *out = make(v1.ResourceList) - for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Capacity = nil - } - if in.Allocatable != nil { - in, out := in.Allocatable, &out.Allocatable - *out = make(v1.ResourceList) - for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Allocatable = nil - } - if err := DeepCopy_v1alpha1_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil { - return err - } - if in.Zones != nil { - in, out := in.Zones, &out.Zones - *out = make([]string, len(in)) - copy(*out, in) - } else { - out.Zones = nil - } - out.Region = in.Region - return nil -} - -func DeepCopy_v1alpha1_ServerAddressByClientCIDR(in ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, c *conversion.Cloner) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/conversion.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion.go similarity index 93% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/conversion.go rename to vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion.go index c4c8ebbb3..f7ca2372a 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/conversion.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "fmt" diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion_generated.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion_generated.go new file mode 100644 index 000000000..fa582e3a6 --- /dev/null +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion_generated.go @@ -0,0 +1,296 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by conversion-gen. Do not edit it manually! + +package v1beta1 + +import ( + federation "k8s.io/kubernetes/federation/apis/federation" + api "k8s.io/kubernetes/pkg/api" + v1 "k8s.io/kubernetes/pkg/api/v1" + conversion "k8s.io/kubernetes/pkg/conversion" +) + +func init() { + if err := api.Scheme.AddGeneratedConversionFuncs( + Convert_v1beta1_Cluster_To_federation_Cluster, + Convert_federation_Cluster_To_v1beta1_Cluster, + Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition, + Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition, + Convert_v1beta1_ClusterList_To_federation_ClusterList, + Convert_federation_ClusterList_To_v1beta1_ClusterList, + Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec, + Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec, + Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus, + Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus, + Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR, + Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR, + ); err != nil { + // if one of the conversion functions is malformed, detect it immediately. + panic(err) + } +} + +func autoConvert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { + return autoConvert_v1beta1_Cluster_To_federation_Cluster(in, out, s) +} + +func autoConvert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { + return autoConvert_federation_Cluster_To_v1beta1_Cluster(in, out, s) +} + +func autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { + out.Type = federation.ClusterConditionType(in.Type) + out.Status = api.ConditionStatus(in.Status) + if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { + return err + } + if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { + return err + } + out.Reason = in.Reason + out.Message = in.Message + return nil +} + +func Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in, out, s) +} + +func autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { + out.Type = ClusterConditionType(in.Type) + out.Status = v1.ConditionStatus(in.Status) + if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { + return err + } + if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { + return err + } + out.Reason = in.Reason + out.Message = in.Message + return nil +} + +func Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { + return autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in, out, s) +} + +func autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil { + return err + } + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]federation.Cluster, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Cluster_To_federation_Cluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in, out, s) +} + +func autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil { + return err + } + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + if err := Convert_federation_Cluster_To_v1beta1_Cluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { + return autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in, out, s) +} + +func autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { + if in.ServerAddressByClientCIDRs != nil { + in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs + *out = make([]federation.ServerAddressByClientCIDR, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.ServerAddressByClientCIDRs = nil + } + if in.SecretRef != nil { + in, out := &in.SecretRef, &out.SecretRef + *out = new(api.LocalObjectReference) + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(*in, *out, 0); err != nil { + return err + } + } else { + out.SecretRef = nil + } + return nil +} + +func Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in, out, s) +} + +func autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { + if in.ServerAddressByClientCIDRs != nil { + in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs + *out = make([]ServerAddressByClientCIDR, len(*in)) + for i := range *in { + if err := Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.ServerAddressByClientCIDRs = nil + } + if in.SecretRef != nil { + in, out := &in.SecretRef, &out.SecretRef + *out = new(v1.LocalObjectReference) + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(*in, *out, 0); err != nil { + return err + } + } else { + out.SecretRef = nil + } + return nil +} + +func Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { + return autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) +} + +func autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]federation.ClusterCondition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Zones = in.Zones + out.Region = in.Region + return nil +} + +func Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in, out, s) +} + +func autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ClusterCondition, len(*in)) + for i := range *in { + if err := Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Zones = in.Zones + out.Region = in.Region + return nil +} + +func Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { + return autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) +} + +func autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { + out.ClientCIDR = in.ClientCIDR + out.ServerAddress = in.ServerAddress + return nil +} + +func Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { + return autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s) +} + +func autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { + out.ClientCIDR = in.ClientCIDR + out.ServerAddress = in.ServerAddress + return nil +} + +func Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { + return autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in, out, s) +} diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/deep_copy_generated.go new file mode 100644 index 000000000..2fd58fa4c --- /dev/null +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/deep_copy_generated.go @@ -0,0 +1,131 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by deepcopy-gen. Do not edit it manually! + +package v1beta1 + +import ( + api "k8s.io/kubernetes/pkg/api" + v1 "k8s.io/kubernetes/pkg/api/v1" + conversion "k8s.io/kubernetes/pkg/conversion" +) + +func init() { + if err := api.Scheme.AddGeneratedDeepCopyFuncs( + DeepCopy_v1beta1_Cluster, + DeepCopy_v1beta1_ClusterCondition, + DeepCopy_v1beta1_ClusterList, + DeepCopy_v1beta1_ClusterSpec, + DeepCopy_v1beta1_ClusterStatus, + DeepCopy_v1beta1_ServerAddressByClientCIDR, + ); err != nil { + // if one of the deep copy functions is malformed, detect it immediately. + panic(err) + } +} + +func DeepCopy_v1beta1_Cluster(in Cluster, out *Cluster, c *conversion.Cloner) error { + out.TypeMeta = in.TypeMeta + if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + return err + } + if err := DeepCopy_v1beta1_ClusterSpec(in.Spec, &out.Spec, c); err != nil { + return err + } + if err := DeepCopy_v1beta1_ClusterStatus(in.Status, &out.Status, c); err != nil { + return err + } + return nil +} + +func DeepCopy_v1beta1_ClusterCondition(in ClusterCondition, out *ClusterCondition, c *conversion.Cloner) error { + out.Type = in.Type + out.Status = in.Status + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() + out.Reason = in.Reason + out.Message = in.Message + return nil +} + +func DeepCopy_v1beta1_ClusterList(in ClusterList, out *ClusterList, c *conversion.Cloner) error { + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := in.Items, &out.Items + *out = make([]Cluster, len(in)) + for i := range in { + if err := DeepCopy_v1beta1_Cluster(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func DeepCopy_v1beta1_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversion.Cloner) error { + if in.ServerAddressByClientCIDRs != nil { + in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs + *out = make([]ServerAddressByClientCIDR, len(in)) + for i := range in { + (*out)[i] = in[i] + } + } else { + out.ServerAddressByClientCIDRs = nil + } + if in.SecretRef != nil { + in, out := in.SecretRef, &out.SecretRef + *out = new(v1.LocalObjectReference) + **out = *in + } else { + out.SecretRef = nil + } + return nil +} + +func DeepCopy_v1beta1_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *conversion.Cloner) error { + if in.Conditions != nil { + in, out := in.Conditions, &out.Conditions + *out = make([]ClusterCondition, len(in)) + for i := range in { + if err := DeepCopy_v1beta1_ClusterCondition(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if in.Zones != nil { + in, out := in.Zones, &out.Zones + *out = make([]string, len(in)) + copy(*out, in) + } else { + out.Zones = nil + } + out.Region = in.Region + return nil +} + +func DeepCopy_v1beta1_ServerAddressByClientCIDR(in ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, c *conversion.Cloner) error { + out.ClientCIDR = in.ClientCIDR + out.ServerAddress = in.ServerAddress + return nil +} diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/defaults.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/defaults.go similarity index 89% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/defaults.go rename to vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/defaults.go index d69bb7f04..54aef235e 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/defaults.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "k8s.io/kubernetes/pkg/runtime" diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/doc.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/doc.go new file mode 100644 index 000000000..3a4f89c98 --- /dev/null +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/federation/apis/federation + +package v1beta1 diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.pb.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.pb.go similarity index 73% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.pb.go rename to vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.pb.go index dbb8c8ad3..c9c4341eb 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,32 +15,29 @@ limitations under the License. */ // Code generated by protoc-gen-gogo. -// source: k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.proto +// source: k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto // DO NOT EDIT! /* - Package v1alpha1 is a generated protocol buffer package. + Package v1beta1 is a generated protocol buffer package. It is generated from these files: - k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.proto + k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto It has these top-level messages: Cluster ClusterCondition ClusterList - ClusterMeta ClusterSpec ClusterStatus ServerAddressByClientCIDR */ -package v1alpha1 +package v1beta1 import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" -import k8s_io_kubernetes_pkg_api_resource "k8s.io/kubernetes/pkg/api/resource" - import k8s_io_kubernetes_pkg_api_v1 "k8s.io/kubernetes/pkg/api/v1" import io "io" @@ -62,10 +59,6 @@ func (m *ClusterList) Reset() { *m = ClusterList{} } func (m *ClusterList) String() string { return proto.CompactTextString(m) } func (*ClusterList) ProtoMessage() {} -func (m *ClusterMeta) Reset() { *m = ClusterMeta{} } -func (m *ClusterMeta) String() string { return proto.CompactTextString(m) } -func (*ClusterMeta) ProtoMessage() {} - func (m *ClusterSpec) Reset() { *m = ClusterSpec{} } func (m *ClusterSpec) String() string { return proto.CompactTextString(m) } func (*ClusterSpec) ProtoMessage() {} @@ -79,13 +72,12 @@ func (m *ServerAddressByClientCIDR) String() string { return proto.CompactTextSt func (*ServerAddressByClientCIDR) ProtoMessage() {} func init() { - proto.RegisterType((*Cluster)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.Cluster") - proto.RegisterType((*ClusterCondition)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterCondition") - proto.RegisterType((*ClusterList)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterList") - proto.RegisterType((*ClusterMeta)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterMeta") - proto.RegisterType((*ClusterSpec)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterSpec") - proto.RegisterType((*ClusterStatus)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterStatus") - proto.RegisterType((*ServerAddressByClientCIDR)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ServerAddressByClientCIDR") + proto.RegisterType((*Cluster)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.Cluster") + proto.RegisterType((*ClusterCondition)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterCondition") + proto.RegisterType((*ClusterList)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterList") + proto.RegisterType((*ClusterSpec)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterSpec") + proto.RegisterType((*ClusterStatus)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterStatus") + proto.RegisterType((*ServerAddressByClientCIDR)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR") } func (m *Cluster) Marshal() (data []byte, err error) { size := m.Size() @@ -217,28 +209,6 @@ func (m *ClusterList) MarshalTo(data []byte) (int, error) { return i, nil } -func (m *ClusterMeta) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ClusterMeta) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Version))) - i += copy(data[i:], m.Version) - return i, nil -} - func (m *ClusterSpec) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -306,58 +276,6 @@ func (m *ClusterStatus) MarshalTo(data []byte) (int, error) { i += n } } - if len(m.Capacity) > 0 { - for k := range m.Capacity { - data[i] = 0x12 - i++ - v := m.Capacity[k] - msgSize := (&v).Size() - mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + msgSize + sovGenerated(uint64(msgSize)) - i = encodeVarintGenerated(data, i, uint64(mapSize)) - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(len(k))) - i += copy(data[i:], k) - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64((&v).Size())) - n8, err := (&v).MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n8 - } - } - if len(m.Allocatable) > 0 { - for k := range m.Allocatable { - data[i] = 0x1a - i++ - v := m.Allocatable[k] - msgSize := (&v).Size() - mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + msgSize + sovGenerated(uint64(msgSize)) - i = encodeVarintGenerated(data, i, uint64(mapSize)) - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(len(k))) - i += copy(data[i:], k) - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64((&v).Size())) - n9, err := (&v).MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n9 - } - } - data[i] = 0x22 - i++ - i = encodeVarintGenerated(data, i, uint64(m.ClusterMeta.Size())) - n10, err := m.ClusterMeta.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n10 if len(m.Zones) > 0 { for _, s := range m.Zones { data[i] = 0x2a @@ -477,14 +395,6 @@ func (m *ClusterList) Size() (n int) { return n } -func (m *ClusterMeta) Size() (n int) { - var l int - _ = l - l = len(m.Version) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - func (m *ClusterSpec) Size() (n int) { var l int _ = l @@ -510,26 +420,6 @@ func (m *ClusterStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } - if len(m.Capacity) > 0 { - for k, v := range m.Capacity { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - if len(m.Allocatable) > 0 { - for k, v := range m.Allocatable { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - l = m.ClusterMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) if len(m.Zones) > 0 { for _, s := range m.Zones { l = len(s) @@ -1041,85 +931,6 @@ func (m *ClusterList) Unmarshal(data []byte) error { } return nil } -func (m *ClusterMeta) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterMeta: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterMeta: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(data[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *ClusterSpec) Unmarshal(data []byte) error { l := len(data) iNdEx := 0 @@ -1294,268 +1105,6 @@ func (m *ClusterStatus) Unmarshal(data []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := k8s_io_kubernetes_pkg_api_v1.ResourceName(data[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue := &k8s_io_kubernetes_pkg_api_resource.Quantity{} - if err := mapvalue.Unmarshal(data[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - if m.Capacity == nil { - m.Capacity = make(k8s_io_kubernetes_pkg_api_v1.ResourceList) - } - m.Capacity[k8s_io_kubernetes_pkg_api_v1.ResourceName(mapkey)] = *mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allocatable", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := k8s_io_kubernetes_pkg_api_v1.ResourceName(data[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue := &k8s_io_kubernetes_pkg_api_resource.Quantity{} - if err := mapvalue.Unmarshal(data[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - if m.Allocatable == nil { - m.Allocatable = make(k8s_io_kubernetes_pkg_api_v1.ResourceList) - } - m.Allocatable[k8s_io_kubernetes_pkg_api_v1.ResourceName(mapkey)] = *mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ClusterMeta.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Zones", wireType) diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.proto b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto similarity index 88% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.proto rename to vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto index ddc9fd32c..d14f69e7f 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.proto +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ limitations under the License. syntax = 'proto2'; -package k8s.io.kubernetes.federation.apis.federation.v1alpha1; +package k8s.io.kubernetes.federation.apis.federation.v1beta1; import "k8s.io/kubernetes/pkg/api/resource/generated.proto"; import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto"; @@ -27,7 +27,7 @@ import "k8s.io/kubernetes/pkg/api/v1/generated.proto"; import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". -option go_package = "v1alpha1"; +option go_package = "v1beta1"; // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. message Cluster { @@ -73,12 +73,6 @@ message ClusterList { repeated Cluster items = 2; } -// Cluster metadata -message ClusterMeta { - // Release version of the cluster. - optional string version = 1; -} - // ClusterSpec describes the attributes of a kubernetes cluster. message ClusterSpec { // A map of client CIDR to server address. @@ -100,14 +94,6 @@ message ClusterStatus { // Conditions is an array of current cluster conditions. repeated ClusterCondition conditions = 1; - // Capacity represents the total resources of the cluster - map capacity = 2; - - // Allocatable represents the total resources of a cluster that are available for scheduling. - map allocatable = 3; - - optional ClusterMeta clusterMeta = 4; - // Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. // These will always be in the same region. repeated string zones = 5; diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/register.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/register.go similarity index 93% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/register.go rename to vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/register.go index 1cb015ec9..7d7195ca1 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/register.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "k8s.io/kubernetes/pkg/api/unversioned" @@ -27,7 +27,7 @@ import ( const GroupName = "federation" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta1"} // Adds the list of known types to api.Scheme. func AddToScheme(scheme *runtime.Scheme) { diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/types.generated.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.generated.go similarity index 85% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/types.generated.go rename to vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.generated.go index 8dd23421d..c959446e2 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/types.generated.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,16 +19,15 @@ limitations under the License. // THIS FILE IS AUTO-GENERATED BY codecgen. // ************************************************************ -package v1alpha1 +package v1beta1 import ( "errors" "fmt" codec1978 "github.com/ugorji/go/codec" - pkg3_resource "k8s.io/kubernetes/pkg/api/resource" pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned" pkg1_v1 "k8s.io/kubernetes/pkg/api/v1" - pkg4_types "k8s.io/kubernetes/pkg/types" + pkg3_types "k8s.io/kubernetes/pkg/types" "reflect" "runtime" time "time" @@ -64,12 +63,11 @@ func init() { panic(err) } if false { // reference the types, but skip this branch at build/run time - var v0 pkg3_resource.Quantity - var v1 pkg2_unversioned.Time - var v2 pkg1_v1.LocalObjectReference - var v3 pkg4_types.UID - var v4 time.Time - _, _, _, _, _ = v0, v1, v2, v3, v4 + var v0 pkg2_unversioned.Time + var v1 pkg1_v1.LocalObjectReference + var v2 pkg3_types.UID + var v3 time.Time + _, _, _, _ = v0, v1, v2, v3 } } @@ -985,175 +983,6 @@ func (x *ClusterCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ClusterMeta) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - yyq2[0] = x.Version != "" - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 0 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("version")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterMeta) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap1234 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray1234 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterMeta) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3 { - case "version": - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterMeta) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj5 int - var yyb5 bool - var yyhl5 bool = l >= 0 - yyj5++ - if yyhl5 { - yyb5 = yyj5 > l - } else { - yyb5 = r.CheckBreak() - } - if yyb5 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } - for { - yyj5++ - if yyhl5 { - yyb5 = yyj5 > l - } else { - yyb5 = r.CheckBreak() - } - if yyb5 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj5-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -1168,18 +997,15 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool + var yyq2 [3]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false yyq2[0] = len(x.Conditions) != 0 - yyq2[1] = len(x.Capacity) != 0 - yyq2[2] = len(x.Allocatable) != 0 - yyq2[3] = len(x.Zones) != 0 - yyq2[4] = x.Region != "" - yyq2[5] = x.Version != "" + yyq2[1] = len(x.Zones) != 0 + yyq2[2] = x.Region != "" var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) + r.EncodeArrayStart(3) } else { yynn2 = 0 for _, b := range yyq2 { @@ -1226,79 +1052,29 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq2[1] { - if x.Capacity == nil { + if x.Zones == nil { r.EncodeNil() } else { - yysf7 := &x.Capacity - yysf7.CodecEncodeSelf(e) + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + z.F.EncSliceStringV(x.Zones, false, e) + } } } else { r.EncodeNil() } } else { if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("capacity")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Capacity == nil { - r.EncodeNil() - } else { - yysf8 := &x.Capacity - yysf8.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[2] { - if x.Allocatable == nil { - r.EncodeNil() - } else { - yysf10 := &x.Allocatable - yysf10.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("allocatable")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Allocatable == nil { - r.EncodeNil() - } else { - yysf11 := &x.Allocatable - yysf11.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[3] { - if x.Zones == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncSliceStringV(x.Zones, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("zones")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Zones == nil { r.EncodeNil() } else { - yym14 := z.EncBinary() - _ = yym14 + yym8 := z.EncBinary() + _ = yym8 if false { } else { z.F.EncSliceStringV(x.Zones, false, e) @@ -1308,9 +1084,9 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[4] { - yym16 := z.EncBinary() - _ = yym16 + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Region)) @@ -1319,43 +1095,18 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2[4] { + if yyq2[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("region")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym17 := z.EncBinary() - _ = yym17 + yym11 := z.EncBinary() + _ = yym11 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Region)) } } } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[5] { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("version")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Version)) - } - } - } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -1429,30 +1180,16 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { h.decSliceClusterCondition((*[]ClusterCondition)(yyv4), d) } } - case "capacity": - if r.TryDecodeAsNil() { - x.Capacity = nil - } else { - yyv6 := &x.Capacity - yyv6.CodecDecodeSelf(d) - } - case "allocatable": - if r.TryDecodeAsNil() { - x.Allocatable = nil - } else { - yyv7 := &x.Allocatable - yyv7.CodecDecodeSelf(d) - } case "zones": if r.TryDecodeAsNil() { x.Zones = nil } else { - yyv8 := &x.Zones - yym9 := z.DecBinary() - _ = yym9 + yyv6 := &x.Zones + yym7 := z.DecBinary() + _ = yym7 if false { } else { - z.F.DecSliceStringX(yyv8, false, d) + z.F.DecSliceStringX(yyv6, false, d) } } case "region": @@ -1461,12 +1198,6 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Region = string(r.DecodeString()) } - case "version": - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 @@ -1478,16 +1209,16 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + var yyj9 int + var yyb9 bool + var yyhl9 bool = l >= 0 + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { + if yyb9 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1495,55 +1226,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv13 := &x.Conditions - yym14 := z.DecBinary() - _ = yym14 + yyv10 := &x.Conditions + yym11 := z.DecBinary() + _ = yym11 if false { } else { - h.decSliceClusterCondition((*[]ClusterCondition)(yyv13), d) + h.decSliceClusterCondition((*[]ClusterCondition)(yyv10), d) } } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Capacity = nil - } else { - yyv15 := &x.Capacity - yyv15.CodecDecodeSelf(d) - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Allocatable = nil - } else { - yyv16 := &x.Allocatable - yyv16.CodecDecodeSelf(d) - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { + if yyb9 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1551,21 +1248,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Zones = nil } else { - yyv17 := &x.Zones - yym18 := z.DecBinary() - _ = yym18 + yyv12 := &x.Zones + yym13 := z.DecBinary() + _ = yym13 if false { } else { - z.F.DecSliceStringX(yyv17, false, d) + z.F.DecSliceStringX(yyv12, false, d) } } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { + if yyb9 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1575,34 +1272,18 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Region = string(r.DecodeString()) } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Version = "" - } else { - x.Version = string(r.DecodeString()) - } for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l } else { - yyb12 = r.CheckBreak() + yyb9 = r.CheckBreak() } - if yyb12 { + if yyb9 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj12-1, "") + z.DecStructFieldNotFound(yyj9-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -2571,7 +2252,7 @@ func (x codecSelfer1234) decSliceCluster(v *[]Cluster, d *codec1978.Decoder) { yyrg1 := len(yyv1) > 0 yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368) + yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 336) if yyrt1 { if yyrl1 <= cap(yyv1) { yyv1 = yyv1[:yyrl1] diff --git a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/types.go b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.go similarity index 86% rename from vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/types.go rename to vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.go index be2dd8f4d..a69608b20 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/federation/v1alpha1/types.go +++ b/vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "k8s.io/kubernetes/pkg/api/unversioned" @@ -71,21 +71,10 @@ type ClusterCondition struct { Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` } -// Cluster metadata -type ClusterMeta struct { - // Release version of the cluster. - Version string `json:"version,omitempty" protobuf:"bytes,1,opt,name=version"` -} - // ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally. type ClusterStatus struct { // Conditions is an array of current cluster conditions. Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` - // Capacity represents the total resources of the cluster - Capacity v1.ResourceList `json:"capacity,omitempty" protobuf:"bytes,2,rep,name=capacity,casttype=k8s.io/kubernetes/pkg/api/v1.ResourceList,castkey=k8s.io/kubernetes/pkg/api/v1.ResourceName"` - // Allocatable represents the total resources of a cluster that are available for scheduling. - Allocatable v1.ResourceList `json:"allocatable,omitempty" protobuf:"bytes,3,rep,name=allocatable,casttype=k8s.io/kubernetes/pkg/api/v1.ResourceList,castkey=k8s.io/kubernetes/pkg/api/v1.ResourceName"` - ClusterMeta `json:",inline" protobuf:"bytes,4,opt,name=clusterMeta"` // Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. // These will always be in the same region. Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"` @@ -93,7 +82,8 @@ type ClusterStatus struct { Region string `json:"region,omitempty" protobuf:"bytes,6,opt,name=region"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. type Cluster struct { diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/clientset.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/clientset.go index 37c13f858..8741b73b4 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/clientset.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -70,18 +70,19 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) { var err error clientset.FederationClient, err = unversionedfederation.NewForConfig(&configShallowCopy) if err != nil { - return &clientset, err + return nil, err } clientset.CoreClient, err = unversionedcore.NewForConfig(&configShallowCopy) if err != nil { - return &clientset, err + return nil, err } clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { glog.Errorf("failed to create the DiscoveryClient: %v", err) + return nil, err } - return &clientset, err + return &clientset, nil } // NewForConfigOrDie creates a new Clientset for the given config and diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/doc.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/doc.go index 40d4accea..96610bb05 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/doc.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/import_known_versions.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/import_known_versions.go index af8c2e743..aa7329b39 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/import_known_versions.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/import_known_versions.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/core_client.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/core_client.go index d308d0fe1..487d36ddb 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/core_client.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/core_client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/doc.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/doc.go index 30cff08b9..7899881b1 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/generated_expansion.go index 65df6665a..9838bf1bb 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/generated_expansion.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/service.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/service.go index 006f601c2..1d7b071e8 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/service.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/service.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type ServiceInterface interface { Get(name string) (*api.Service, error) List(opts api.ListOptions) (*api.ServiceList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Service, err error) ServiceExpansion } @@ -147,3 +148,16 @@ func (c *services) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched service. +func (c *services) Patch(name string, pt api.PatchType, data []byte) (result *api.Service, err error) { + result = &api.Service{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("services"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/cluster.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/cluster.go index e27095145..cdeb36143 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/cluster.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/cluster.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type ClusterInterface interface { Get(name string) (*federation.Cluster, error) List(opts api.ListOptions) (*federation.ClusterList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *federation.Cluster, err error) ClusterExpansion } @@ -138,3 +139,15 @@ func (c *clusters) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched cluster. +func (c *clusters) Patch(name string, pt api.PatchType, data []byte) (result *federation.Cluster, err error) { + result = &federation.Cluster{} + err = c.client.Patch(pt). + Resource("clusters"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/doc.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/doc.go index 30cff08b9..7899881b1 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/federation_client.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/federation_client.go index be2a8a153..899433154 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/federation_client.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/federation_client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/generated_expansion.go index 8888bf9bd..13903a4cd 100644 --- a/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/generated_expansion.go +++ b/vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/unversioned/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/annotations/annotations.go b/vendor/k8s.io/kubernetes/pkg/api/annotations/annotations.go index dbdf11cba..2f9a6c442 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/annotations/annotations.go +++ b/vendor/k8s.io/kubernetes/pkg/api/annotations/annotations.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/annotations/doc.go b/vendor/k8s.io/kubernetes/pkg/api/annotations/doc.go index 6a422ea4f..0c36c85cc 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/annotations/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/api/annotations/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/context.go b/vendor/k8s.io/kubernetes/pkg/api/context.go index 7e8639571..096144b83 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/context.go +++ b/vendor/k8s.io/kubernetes/pkg/api/context.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/conversion.go b/vendor/k8s.io/kubernetes/pkg/api/conversion.go index 7ae1e0184..07585d8c3 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/api/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -100,15 +100,12 @@ func Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(in, out *unversioned.T } func Convert_unversioned_ListMeta_To_unversioned_ListMeta(in, out *unversioned.ListMeta, s conversion.Scope) error { - out.ResourceVersion = in.ResourceVersion - out.SelfLink = in.SelfLink + *out = *in return nil } func Convert_intstr_IntOrString_To_intstr_IntOrString(in, out *intstr.IntOrString, s conversion.Scope) error { - out.Type = in.Type - out.IntVal = in.IntVal - out.StrVal = in.StrVal + *out = *in return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/api/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/api/deep_copy_generated.go index f3181b8a7..340f36561 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,14 +21,12 @@ limitations under the License. package api import ( - resource "k8s.io/kubernetes/pkg/api/resource" unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" fields "k8s.io/kubernetes/pkg/fields" labels "k8s.io/kubernetes/pkg/labels" runtime "k8s.io/kubernetes/pkg/runtime" types "k8s.io/kubernetes/pkg/types" - intstr "k8s.io/kubernetes/pkg/util/intstr" ) func init() { @@ -243,15 +241,11 @@ func DeepCopy_api_AzureFileVolumeSource(in AzureFileVolumeSource, out *AzureFile } func DeepCopy_api_Binding(in Binding, out *Binding, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_api_ObjectReference(in.Target, &out.Target, c); err != nil { - return err - } + out.Target = in.Target return nil } @@ -291,9 +285,7 @@ func DeepCopy_api_CephFSVolumeSource(in CephFSVolumeSource, out *CephFSVolumeSou if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(LocalObjectReference) - if err := DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretRef = nil } @@ -317,9 +309,7 @@ func DeepCopy_api_ComponentCondition(in ComponentCondition, out *ComponentCondit } func DeepCopy_api_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -327,9 +317,7 @@ func DeepCopy_api_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *c in, out := in.Conditions, &out.Conditions *out = make([]ComponentCondition, len(in)) for i := range in { - if err := DeepCopy_api_ComponentCondition(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Conditions = nil @@ -338,12 +326,8 @@ func DeepCopy_api_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *c } func DeepCopy_api_ComponentStatusList(in ComponentStatusList, out *ComponentStatusList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ComponentStatus, len(in)) @@ -359,9 +343,7 @@ func DeepCopy_api_ComponentStatusList(in ComponentStatusList, out *ComponentStat } func DeepCopy_api_ConfigMap(in ConfigMap, out *ConfigMap, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -378,20 +360,14 @@ func DeepCopy_api_ConfigMap(in ConfigMap, out *ConfigMap, c *conversion.Cloner) } func DeepCopy_api_ConfigMapKeySelector(in ConfigMapKeySelector, out *ConfigMapKeySelector, c *conversion.Cloner) error { - if err := DeepCopy_api_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { - return err - } + out.LocalObjectReference = in.LocalObjectReference out.Key = in.Key return nil } func DeepCopy_api_ConfigMapList(in ConfigMapList, out *ConfigMapList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ConfigMap, len(in)) @@ -407,16 +383,12 @@ func DeepCopy_api_ConfigMapList(in ConfigMapList, out *ConfigMapList, c *convers } func DeepCopy_api_ConfigMapVolumeSource(in ConfigMapVolumeSource, out *ConfigMapVolumeSource, c *conversion.Cloner) error { - if err := DeepCopy_api_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { - return err - } + out.LocalObjectReference = in.LocalObjectReference if in.Items != nil { in, out := in.Items, &out.Items *out = make([]KeyToPath, len(in)) for i := range in { - if err := DeepCopy_api_KeyToPath(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Items = nil @@ -446,9 +418,7 @@ func DeepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) in, out := in.Ports, &out.Ports *out = make([]ContainerPort, len(in)) for i := range in { - if err := DeepCopy_api_ContainerPort(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ports = nil @@ -471,9 +441,7 @@ func DeepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) in, out := in.VolumeMounts, &out.VolumeMounts *out = make([]VolumeMount, len(in)) for i := range in { - if err := DeepCopy_api_VolumeMount(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.VolumeMounts = nil @@ -547,9 +515,7 @@ func DeepCopy_api_ContainerState(in ContainerState, out *ContainerState, c *conv if in.Waiting != nil { in, out := in.Waiting, &out.Waiting *out = new(ContainerStateWaiting) - if err := DeepCopy_api_ContainerStateWaiting(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Waiting = nil } @@ -575,9 +541,7 @@ func DeepCopy_api_ContainerState(in ContainerState, out *ContainerState, c *conv } func DeepCopy_api_ContainerStateRunning(in ContainerStateRunning, out *ContainerStateRunning, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_Time(in.StartedAt, &out.StartedAt, c); err != nil { - return err - } + out.StartedAt = in.StartedAt.DeepCopy() return nil } @@ -586,12 +550,8 @@ func DeepCopy_api_ContainerStateTerminated(in ContainerStateTerminated, out *Con out.Signal = in.Signal out.Reason = in.Reason out.Message = in.Message - if err := unversioned.DeepCopy_unversioned_Time(in.StartedAt, &out.StartedAt, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.FinishedAt, &out.FinishedAt, c); err != nil { - return err - } + out.StartedAt = in.StartedAt.DeepCopy() + out.FinishedAt = in.FinishedAt.DeepCopy() out.ContainerID = in.ContainerID return nil } @@ -643,9 +603,7 @@ func DeepCopy_api_DaemonEndpoint(in DaemonEndpoint, out *DaemonEndpoint, c *conv } func DeepCopy_api_DeleteOptions(in DeleteOptions, out *DeleteOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if in.GracePeriodSeconds != nil { in, out := in.GracePeriodSeconds, &out.GracePeriodSeconds *out = new(int64) @@ -677,9 +635,7 @@ func DeepCopy_api_DownwardAPIVolumeFile(in DownwardAPIVolumeFile, out *DownwardA if in.FieldRef != nil { in, out := in.FieldRef, &out.FieldRef *out = new(ObjectFieldSelector) - if err := DeepCopy_api_ObjectFieldSelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.FieldRef = nil } @@ -721,9 +677,7 @@ func DeepCopy_api_EndpointAddress(in EndpointAddress, out *EndpointAddress, c *c if in.TargetRef != nil { in, out := in.TargetRef, &out.TargetRef *out = new(ObjectReference) - if err := DeepCopy_api_ObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.TargetRef = nil } @@ -764,9 +718,7 @@ func DeepCopy_api_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conv in, out := in.Ports, &out.Ports *out = make([]EndpointPort, len(in)) for i := range in { - if err := DeepCopy_api_EndpointPort(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ports = nil @@ -775,9 +727,7 @@ func DeepCopy_api_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conv } func DeepCopy_api_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -796,12 +746,8 @@ func DeepCopy_api_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) } func DeepCopy_api_EndpointsList(in EndpointsList, out *EndpointsList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Endpoints, len(in)) @@ -835,9 +781,7 @@ func DeepCopy_api_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion if in.FieldRef != nil { in, out := in.FieldRef, &out.FieldRef *out = new(ObjectFieldSelector) - if err := DeepCopy_api_ObjectFieldSelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.FieldRef = nil } @@ -853,18 +797,14 @@ func DeepCopy_api_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion if in.ConfigMapKeyRef != nil { in, out := in.ConfigMapKeyRef, &out.ConfigMapKeyRef *out = new(ConfigMapKeySelector) - if err := DeepCopy_api_ConfigMapKeySelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ConfigMapKeyRef = nil } if in.SecretKeyRef != nil { in, out := in.SecretKeyRef, &out.SecretKeyRef *out = new(SecretKeySelector) - if err := DeepCopy_api_SecretKeySelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretKeyRef = nil } @@ -872,38 +812,24 @@ func DeepCopy_api_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion } func DeepCopy_api_Event(in Event, out *Event, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_api_ObjectReference(in.InvolvedObject, &out.InvolvedObject, c); err != nil { - return err - } + out.InvolvedObject = in.InvolvedObject out.Reason = in.Reason out.Message = in.Message - if err := DeepCopy_api_EventSource(in.Source, &out.Source, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.FirstTimestamp, &out.FirstTimestamp, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTimestamp, &out.LastTimestamp, c); err != nil { - return err - } + out.Source = in.Source + out.FirstTimestamp = in.FirstTimestamp.DeepCopy() + out.LastTimestamp = in.LastTimestamp.DeepCopy() out.Count = in.Count out.Type = in.Type return nil } func DeepCopy_api_EventList(in EventList, out *EventList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Event, len(in)) @@ -936,9 +862,7 @@ func DeepCopy_api_ExecAction(in ExecAction, out *ExecAction, c *conversion.Clone } func DeepCopy_api_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Export = in.Export out.Exact = in.Exact return nil @@ -970,9 +894,7 @@ func DeepCopy_api_FlexVolumeSource(in FlexVolumeSource, out *FlexVolumeSource, c if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(LocalObjectReference) - if err := DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretRef = nil } @@ -1018,18 +940,14 @@ func DeepCopy_api_GlusterfsVolumeSource(in GlusterfsVolumeSource, out *Glusterfs func DeepCopy_api_HTTPGetAction(in HTTPGetAction, out *HTTPGetAction, c *conversion.Cloner) error { out.Path = in.Path - if err := intstr.DeepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { - return err - } + out.Port = in.Port out.Host = in.Host out.Scheme = in.Scheme if in.HTTPHeaders != nil { in, out := in.HTTPHeaders, &out.HTTPHeaders *out = make([]HTTPHeader, len(in)) for i := range in { - if err := DeepCopy_api_HTTPHeader(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.HTTPHeaders = nil @@ -1065,9 +983,7 @@ func DeepCopy_api_Handler(in Handler, out *Handler, c *conversion.Cloner) error if in.TCPSocket != nil { in, out := in.TCPSocket, &out.TCPSocket *out = new(TCPSocketAction) - if err := DeepCopy_api_TCPSocketAction(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.TCPSocket = nil } @@ -1118,9 +1034,7 @@ func DeepCopy_api_Lifecycle(in Lifecycle, out *Lifecycle, c *conversion.Cloner) } func DeepCopy_api_LimitRange(in LimitRange, out *LimitRange, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -1136,11 +1050,7 @@ func DeepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conv in, out := in.Max, &out.Max *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Max = nil @@ -1149,11 +1059,7 @@ func DeepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conv in, out := in.Min, &out.Min *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Min = nil @@ -1162,11 +1068,7 @@ func DeepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conv in, out := in.Default, &out.Default *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Default = nil @@ -1175,11 +1077,7 @@ func DeepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conv in, out := in.DefaultRequest, &out.DefaultRequest *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.DefaultRequest = nil @@ -1188,11 +1086,7 @@ func DeepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conv in, out := in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.MaxLimitRequestRatio = nil @@ -1201,12 +1095,8 @@ func DeepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conv } func DeepCopy_api_LimitRangeList(in LimitRangeList, out *LimitRangeList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]LimitRange, len(in)) @@ -1237,12 +1127,8 @@ func DeepCopy_api_LimitRangeSpec(in LimitRangeSpec, out *LimitRangeSpec, c *conv } func DeepCopy_api_List(in List, out *List, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]runtime.Object, len(in)) @@ -1260,9 +1146,7 @@ func DeepCopy_api_List(in List, out *List, c *conversion.Cloner) error { } func DeepCopy_api_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if in.LabelSelector == nil { out.LabelSelector = nil } else if newVal, err := c.DeepCopy(in.LabelSelector); err != nil { @@ -1300,9 +1184,7 @@ func DeepCopy_api_LoadBalancerStatus(in LoadBalancerStatus, out *LoadBalancerSta in, out := in.Ingress, &out.Ingress *out = make([]LoadBalancerIngress, len(in)) for i := range in { - if err := DeepCopy_api_LoadBalancerIngress(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ingress = nil @@ -1323,28 +1205,20 @@ func DeepCopy_api_NFSVolumeSource(in NFSVolumeSource, out *NFSVolumeSource, c *c } func DeepCopy_api_Namespace(in Namespace, out *Namespace, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_api_NamespaceSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_api_NamespaceStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_api_NamespaceList(in NamespaceList, out *NamespaceList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Namespace, len(in)) @@ -1378,15 +1252,11 @@ func DeepCopy_api_NamespaceStatus(in NamespaceStatus, out *NamespaceStatus, c *c } func DeepCopy_api_Node(in Node, out *Node, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_api_NodeSpec(in.Spec, &out.Spec, c); err != nil { - return err - } + out.Spec = in.Spec if err := DeepCopy_api_NodeStatus(in.Status, &out.Status, c); err != nil { return err } @@ -1426,31 +1296,21 @@ func DeepCopy_api_NodeAffinity(in NodeAffinity, out *NodeAffinity, c *conversion func DeepCopy_api_NodeCondition(in NodeCondition, out *NodeCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastHeartbeatTime, &out.LastHeartbeatTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastHeartbeatTime = in.LastHeartbeatTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_api_NodeDaemonEndpoints(in NodeDaemonEndpoints, out *NodeDaemonEndpoints, c *conversion.Cloner) error { - if err := DeepCopy_api_DaemonEndpoint(in.KubeletEndpoint, &out.KubeletEndpoint, c); err != nil { - return err - } + out.KubeletEndpoint = in.KubeletEndpoint return nil } func DeepCopy_api_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Node, len(in)) @@ -1466,9 +1326,7 @@ func DeepCopy_api_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) err } func DeepCopy_api_NodeProxyOptions(in NodeProxyOptions, out *NodeProxyOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Path = in.Path return nil } @@ -1478,11 +1336,7 @@ func DeepCopy_api_NodeResources(in NodeResources, out *NodeResources, c *convers in, out := in.Capacity, &out.Capacity *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Capacity = nil @@ -1546,11 +1400,7 @@ func DeepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Clone in, out := in.Capacity, &out.Capacity *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Capacity = nil @@ -1559,11 +1409,7 @@ func DeepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Clone in, out := in.Allocatable, &out.Allocatable *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Allocatable = nil @@ -1584,19 +1430,13 @@ func DeepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Clone in, out := in.Addresses, &out.Addresses *out = make([]NodeAddress, len(in)) for i := range in { - if err := DeepCopy_api_NodeAddress(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Addresses = nil } - if err := DeepCopy_api_NodeDaemonEndpoints(in.DaemonEndpoints, &out.DaemonEndpoints, c); err != nil { - return err - } - if err := DeepCopy_api_NodeSystemInfo(in.NodeInfo, &out.NodeInfo, c); err != nil { - return err - } + out.DaemonEndpoints = in.DaemonEndpoints + out.NodeInfo = in.NodeInfo if in.Images != nil { in, out := in.Images, &out.Images *out = make([]ContainerImage, len(in)) @@ -1621,9 +1461,7 @@ func DeepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Clone in, out := in.VolumesAttached, &out.VolumesAttached *out = make([]AttachedVolume, len(in)) for i := range in { - if err := DeepCopy_api_AttachedVolume(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.VolumesAttached = nil @@ -1659,15 +1497,11 @@ func DeepCopy_api_ObjectMeta(in ObjectMeta, out *ObjectMeta, c *conversion.Clone out.UID = in.UID out.ResourceVersion = in.ResourceVersion out.Generation = in.Generation - if err := unversioned.DeepCopy_unversioned_Time(in.CreationTimestamp, &out.CreationTimestamp, c); err != nil { - return err - } + out.CreationTimestamp = in.CreationTimestamp.DeepCopy() if in.DeletionTimestamp != nil { in, out := in.DeletionTimestamp, &out.DeletionTimestamp *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.DeletionTimestamp = nil } @@ -1744,25 +1578,19 @@ func DeepCopy_api_OwnerReference(in OwnerReference, out *OwnerReference, c *conv } func DeepCopy_api_PersistentVolume(in PersistentVolume, out *PersistentVolume, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_api_PersistentVolumeSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_api_PersistentVolumeStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_api_PersistentVolumeClaim(in PersistentVolumeClaim, out *PersistentVolumeClaim, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -1776,12 +1604,8 @@ func DeepCopy_api_PersistentVolumeClaim(in PersistentVolumeClaim, out *Persisten } func DeepCopy_api_PersistentVolumeClaimList(in PersistentVolumeClaimList, out *PersistentVolumeClaimList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PersistentVolumeClaim, len(in)) @@ -1837,11 +1661,7 @@ func DeepCopy_api_PersistentVolumeClaimStatus(in PersistentVolumeClaimStatus, ou in, out := in.Capacity, &out.Capacity *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Capacity = nil @@ -1856,12 +1676,8 @@ func DeepCopy_api_PersistentVolumeClaimVolumeSource(in PersistentVolumeClaimVolu } func DeepCopy_api_PersistentVolumeList(in PersistentVolumeList, out *PersistentVolumeList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PersistentVolume, len(in)) @@ -1880,45 +1696,35 @@ func DeepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.GCEPersistentDisk != nil { in, out := in.GCEPersistentDisk, &out.GCEPersistentDisk *out = new(GCEPersistentDiskVolumeSource) - if err := DeepCopy_api_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.GCEPersistentDisk = nil } if in.AWSElasticBlockStore != nil { in, out := in.AWSElasticBlockStore, &out.AWSElasticBlockStore *out = new(AWSElasticBlockStoreVolumeSource) - if err := DeepCopy_api_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AWSElasticBlockStore = nil } if in.HostPath != nil { in, out := in.HostPath, &out.HostPath *out = new(HostPathVolumeSource) - if err := DeepCopy_api_HostPathVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.HostPath = nil } if in.Glusterfs != nil { in, out := in.Glusterfs, &out.Glusterfs *out = new(GlusterfsVolumeSource) - if err := DeepCopy_api_GlusterfsVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Glusterfs = nil } if in.NFS != nil { in, out := in.NFS, &out.NFS *out = new(NFSVolumeSource) - if err := DeepCopy_api_NFSVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NFS = nil } @@ -1934,9 +1740,7 @@ func DeepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.ISCSI != nil { in, out := in.ISCSI, &out.ISCSI *out = new(ISCSIVolumeSource) - if err := DeepCopy_api_ISCSIVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ISCSI = nil } @@ -1952,9 +1756,7 @@ func DeepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.Cinder != nil { in, out := in.Cinder, &out.Cinder *out = new(CinderVolumeSource) - if err := DeepCopy_api_CinderVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Cinder = nil } @@ -1979,27 +1781,21 @@ func DeepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.Flocker != nil { in, out := in.Flocker, &out.Flocker *out = new(FlockerVolumeSource) - if err := DeepCopy_api_FlockerVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Flocker = nil } if in.AzureFile != nil { in, out := in.AzureFile, &out.AzureFile *out = new(AzureFileVolumeSource) - if err := DeepCopy_api_AzureFileVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AzureFile = nil } if in.VsphereVolume != nil { in, out := in.VsphereVolume, &out.VsphereVolume *out = new(VsphereVirtualDiskVolumeSource) - if err := DeepCopy_api_VsphereVirtualDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.VsphereVolume = nil } @@ -2011,11 +1807,7 @@ func DeepCopy_api_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentV in, out := in.Capacity, &out.Capacity *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Capacity = nil @@ -2035,9 +1827,7 @@ func DeepCopy_api_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentV if in.ClaimRef != nil { in, out := in.ClaimRef, &out.ClaimRef *out = new(ObjectReference) - if err := DeepCopy_api_ObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ClaimRef = nil } @@ -2053,9 +1843,7 @@ func DeepCopy_api_PersistentVolumeStatus(in PersistentVolumeStatus, out *Persist } func DeepCopy_api_Pod(in Pod, out *Pod, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2142,9 +1930,7 @@ func DeepCopy_api_PodAntiAffinity(in PodAntiAffinity, out *PodAntiAffinity, c *c } func DeepCopy_api_PodAttachOptions(in PodAttachOptions, out *PodAttachOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Stdin = in.Stdin out.Stdout = in.Stdout out.Stderr = in.Stderr @@ -2156,21 +1942,15 @@ func DeepCopy_api_PodAttachOptions(in PodAttachOptions, out *PodAttachOptions, c func DeepCopy_api_PodCondition(in PodCondition, out *PodCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_api_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Stdin = in.Stdin out.Stdout = in.Stdout out.Stderr = in.Stderr @@ -2187,12 +1967,8 @@ func DeepCopy_api_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conv } func DeepCopy_api_PodList(in PodList, out *PodList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Pod, len(in)) @@ -2208,9 +1984,7 @@ func DeepCopy_api_PodList(in PodList, out *PodList, c *conversion.Cloner) error } func DeepCopy_api_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Container = in.Container out.Follow = in.Follow out.Previous = in.Previous @@ -2224,9 +1998,7 @@ func DeepCopy_api_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *convers if in.SinceTime != nil { in, out := in.SinceTime, &out.SinceTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.SinceTime = nil } @@ -2249,9 +2021,7 @@ func DeepCopy_api_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *convers } func DeepCopy_api_PodProxyOptions(in PodProxyOptions, out *PodProxyOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Path = in.Path return nil } @@ -2263,9 +2033,7 @@ func DeepCopy_api_PodSecurityContext(in PodSecurityContext, out *PodSecurityCont if in.SELinuxOptions != nil { in, out := in.SELinuxOptions, &out.SELinuxOptions *out = new(SELinuxOptions) - if err := DeepCopy_api_SELinuxOptions(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SELinuxOptions = nil } @@ -2374,9 +2142,7 @@ func DeepCopy_api_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error in, out := in.ImagePullSecrets, &out.ImagePullSecrets *out = make([]LocalObjectReference, len(in)) for i := range in { - if err := DeepCopy_api_LocalObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.ImagePullSecrets = nil @@ -2406,9 +2172,7 @@ func DeepCopy_api_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) if in.StartTime != nil { in, out := in.StartTime, &out.StartTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.StartTime = nil } @@ -2438,9 +2202,7 @@ func DeepCopy_api_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) } func DeepCopy_api_PodStatusResult(in PodStatusResult, out *PodStatusResult, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2451,9 +2213,7 @@ func DeepCopy_api_PodStatusResult(in PodStatusResult, out *PodStatusResult, c *c } func DeepCopy_api_PodTemplate(in PodTemplate, out *PodTemplate, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2464,12 +2224,8 @@ func DeepCopy_api_PodTemplate(in PodTemplate, out *PodTemplate, c *conversion.Cl } func DeepCopy_api_PodTemplateList(in PodTemplateList, out *PodTemplateList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PodTemplate, len(in)) @@ -2541,9 +2297,7 @@ func DeepCopy_api_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *c if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(LocalObjectReference) - if err := DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretRef = nil } @@ -2552,9 +2306,7 @@ func DeepCopy_api_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *c } func DeepCopy_api_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2570,28 +2322,20 @@ func DeepCopy_api_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *c } func DeepCopy_api_ReplicationController(in ReplicationController, out *ReplicationController, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_api_ReplicationControllerSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_api_ReplicationControllerStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_api_ReplicationControllerList(in ReplicationControllerList, out *ReplicationControllerList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ReplicationController, len(in)) @@ -2639,16 +2383,12 @@ func DeepCopy_api_ReplicationControllerStatus(in ReplicationControllerStatus, ou func DeepCopy_api_ResourceFieldSelector(in ResourceFieldSelector, out *ResourceFieldSelector, c *conversion.Cloner) error { out.ContainerName = in.ContainerName out.Resource = in.Resource - if err := resource.DeepCopy_resource_Quantity(in.Divisor, &out.Divisor, c); err != nil { - return err - } + out.Divisor = in.Divisor.DeepCopy() return nil } func DeepCopy_api_ResourceQuota(in ResourceQuota, out *ResourceQuota, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2662,12 +2402,8 @@ func DeepCopy_api_ResourceQuota(in ResourceQuota, out *ResourceQuota, c *convers } func DeepCopy_api_ResourceQuotaList(in ResourceQuotaList, out *ResourceQuotaList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ResourceQuota, len(in)) @@ -2687,11 +2423,7 @@ func DeepCopy_api_ResourceQuotaSpec(in ResourceQuotaSpec, out *ResourceQuotaSpec in, out := in.Hard, &out.Hard *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Hard = nil @@ -2713,11 +2445,7 @@ func DeepCopy_api_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuota in, out := in.Hard, &out.Hard *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Hard = nil @@ -2726,11 +2454,7 @@ func DeepCopy_api_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuota in, out := in.Used, &out.Used *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Used = nil @@ -2743,11 +2467,7 @@ func DeepCopy_api_ResourceRequirements(in ResourceRequirements, out *ResourceReq in, out := in.Limits, &out.Limits *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Limits = nil @@ -2756,11 +2476,7 @@ func DeepCopy_api_ResourceRequirements(in ResourceRequirements, out *ResourceReq in, out := in.Requests, &out.Requests *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Requests = nil @@ -2777,9 +2493,7 @@ func DeepCopy_api_SELinuxOptions(in SELinuxOptions, out *SELinuxOptions, c *conv } func DeepCopy_api_Secret(in Secret, out *Secret, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2801,20 +2515,14 @@ func DeepCopy_api_Secret(in Secret, out *Secret, c *conversion.Cloner) error { } func DeepCopy_api_SecretKeySelector(in SecretKeySelector, out *SecretKeySelector, c *conversion.Cloner) error { - if err := DeepCopy_api_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { - return err - } + out.LocalObjectReference = in.LocalObjectReference out.Key = in.Key return nil } func DeepCopy_api_SecretList(in SecretList, out *SecretList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Secret, len(in)) @@ -2835,9 +2543,7 @@ func DeepCopy_api_SecretVolumeSource(in SecretVolumeSource, out *SecretVolumeSou in, out := in.Items, &out.Items *out = make([]KeyToPath, len(in)) for i := range in { - if err := DeepCopy_api_KeyToPath(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Items = nil @@ -2865,9 +2571,7 @@ func DeepCopy_api_SecurityContext(in SecurityContext, out *SecurityContext, c *c if in.SELinuxOptions != nil { in, out := in.SELinuxOptions, &out.SELinuxOptions *out = new(SELinuxOptions) - if err := DeepCopy_api_SELinuxOptions(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SELinuxOptions = nil } @@ -2896,19 +2600,13 @@ func DeepCopy_api_SecurityContext(in SecurityContext, out *SecurityContext, c *c } func DeepCopy_api_SerializedReference(in SerializedReference, out *SerializedReference, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := DeepCopy_api_ObjectReference(in.Reference, &out.Reference, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.Reference = in.Reference return nil } func DeepCopy_api_Service(in Service, out *Service, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2922,9 +2620,7 @@ func DeepCopy_api_Service(in Service, out *Service, c *conversion.Cloner) error } func DeepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2932,9 +2628,7 @@ func DeepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conv in, out := in.Secrets, &out.Secrets *out = make([]ObjectReference, len(in)) for i := range in { - if err := DeepCopy_api_ObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Secrets = nil @@ -2943,9 +2637,7 @@ func DeepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conv in, out := in.ImagePullSecrets, &out.ImagePullSecrets *out = make([]LocalObjectReference, len(in)) for i := range in { - if err := DeepCopy_api_LocalObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.ImagePullSecrets = nil @@ -2954,12 +2646,8 @@ func DeepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conv } func DeepCopy_api_ServiceAccountList(in ServiceAccountList, out *ServiceAccountList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ServiceAccount, len(in)) @@ -2975,12 +2663,8 @@ func DeepCopy_api_ServiceAccountList(in ServiceAccountList, out *ServiceAccountL } func DeepCopy_api_ServiceList(in ServiceList, out *ServiceList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Service, len(in)) @@ -2999,17 +2683,13 @@ func DeepCopy_api_ServicePort(in ServicePort, out *ServicePort, c *conversion.Cl out.Name = in.Name out.Protocol = in.Protocol out.Port = in.Port - if err := intstr.DeepCopy_intstr_IntOrString(in.TargetPort, &out.TargetPort, c); err != nil { - return err - } + out.TargetPort = in.TargetPort out.NodePort = in.NodePort return nil } func DeepCopy_api_ServiceProxyOptions(in ServiceProxyOptions, out *ServiceProxyOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Path = in.Path return nil } @@ -3020,9 +2700,7 @@ func DeepCopy_api_ServiceSpec(in ServiceSpec, out *ServiceSpec, c *conversion.Cl in, out := in.Ports, &out.Ports *out = make([]ServicePort, len(in)) for i := range in { - if err := DeepCopy_api_ServicePort(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ports = nil @@ -3064,9 +2742,7 @@ func DeepCopy_api_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *convers } func DeepCopy_api_TCPSocketAction(in TCPSocketAction, out *TCPSocketAction, c *conversion.Cloner) error { - if err := intstr.DeepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { - return err - } + out.Port = in.Port return nil } @@ -3105,45 +2781,35 @@ func DeepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.HostPath != nil { in, out := in.HostPath, &out.HostPath *out = new(HostPathVolumeSource) - if err := DeepCopy_api_HostPathVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.HostPath = nil } if in.EmptyDir != nil { in, out := in.EmptyDir, &out.EmptyDir *out = new(EmptyDirVolumeSource) - if err := DeepCopy_api_EmptyDirVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.EmptyDir = nil } if in.GCEPersistentDisk != nil { in, out := in.GCEPersistentDisk, &out.GCEPersistentDisk *out = new(GCEPersistentDiskVolumeSource) - if err := DeepCopy_api_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.GCEPersistentDisk = nil } if in.AWSElasticBlockStore != nil { in, out := in.AWSElasticBlockStore, &out.AWSElasticBlockStore *out = new(AWSElasticBlockStoreVolumeSource) - if err := DeepCopy_api_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AWSElasticBlockStore = nil } if in.GitRepo != nil { in, out := in.GitRepo, &out.GitRepo *out = new(GitRepoVolumeSource) - if err := DeepCopy_api_GitRepoVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.GitRepo = nil } @@ -3159,36 +2825,28 @@ func DeepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.NFS != nil { in, out := in.NFS, &out.NFS *out = new(NFSVolumeSource) - if err := DeepCopy_api_NFSVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NFS = nil } if in.ISCSI != nil { in, out := in.ISCSI, &out.ISCSI *out = new(ISCSIVolumeSource) - if err := DeepCopy_api_ISCSIVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ISCSI = nil } if in.Glusterfs != nil { in, out := in.Glusterfs, &out.Glusterfs *out = new(GlusterfsVolumeSource) - if err := DeepCopy_api_GlusterfsVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Glusterfs = nil } if in.PersistentVolumeClaim != nil { in, out := in.PersistentVolumeClaim, &out.PersistentVolumeClaim *out = new(PersistentVolumeClaimVolumeSource) - if err := DeepCopy_api_PersistentVolumeClaimVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.PersistentVolumeClaim = nil } @@ -3213,9 +2871,7 @@ func DeepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.Cinder != nil { in, out := in.Cinder, &out.Cinder *out = new(CinderVolumeSource) - if err := DeepCopy_api_CinderVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Cinder = nil } @@ -3231,9 +2887,7 @@ func DeepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.Flocker != nil { in, out := in.Flocker, &out.Flocker *out = new(FlockerVolumeSource) - if err := DeepCopy_api_FlockerVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Flocker = nil } @@ -3258,9 +2912,7 @@ func DeepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.AzureFile != nil { in, out := in.AzureFile, &out.AzureFile *out = new(AzureFileVolumeSource) - if err := DeepCopy_api_AzureFileVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AzureFile = nil } @@ -3276,9 +2928,7 @@ func DeepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.VsphereVolume != nil { in, out := in.VsphereVolume, &out.VsphereVolume *out = new(VsphereVirtualDiskVolumeSource) - if err := DeepCopy_api_VsphereVirtualDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.VsphereVolume = nil } diff --git a/vendor/k8s.io/kubernetes/pkg/api/doc.go b/vendor/k8s.io/kubernetes/pkg/api/doc.go index 8a54f7acc..1507a8823 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/api/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:deepcopy-gen=package,register + // Package api contains the latest (or "internal") version of the // Kubernetes API objects. This is the API objects as represented in memory. // The contract presented to clients is located in the versioned packages, diff --git a/vendor/k8s.io/kubernetes/pkg/api/endpoints/util.go b/vendor/k8s.io/kubernetes/pkg/api/endpoints/util.go index 501d58f28..792a2536f 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/endpoints/util.go +++ b/vendor/k8s.io/kubernetes/pkg/api/endpoints/util.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/errors/doc.go b/vendor/k8s.io/kubernetes/pkg/api/errors/doc.go index 3a2eb2a0a..58751ed0e 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/errors/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/api/errors/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/errors/errors.go b/vendor/k8s.io/kubernetes/pkg/api/errors/errors.go index 89e83c2e3..a51fe9414 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/errors/errors.go +++ b/vendor/k8s.io/kubernetes/pkg/api/errors/errors.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/field_constants.go b/vendor/k8s.io/kubernetes/pkg/api/field_constants.go index 94a825caf..5ead0f13f 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/field_constants.go +++ b/vendor/k8s.io/kubernetes/pkg/api/field_constants.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/generate.go b/vendor/k8s.io/kubernetes/pkg/api/generate.go index 2cca5e52f..19379d301 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/generate.go +++ b/vendor/k8s.io/kubernetes/pkg/api/generate.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/helpers.go b/vendor/k8s.io/kubernetes/pkg/api/helpers.go index 1349ef62b..ca873b309 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/helpers.go +++ b/vendor/k8s.io/kubernetes/pkg/api/helpers.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -424,6 +424,10 @@ const ( // SeccompContainerAnnotationKeyPrefix represents the key of a seccomp profile applied // 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. + CreatedByAnnotation = "kubernetes.io/created-by" ) // GetAffinityFromPod gets the json serialized affinity data from Pod.Annotations @@ -466,7 +470,7 @@ func GetTaintsFromNodeAnnotations(annotations map[string]string) ([]Taint, error } // TolerationToleratesTaint checks if the toleration tolerates the taint. -func TolerationToleratesTaint(toleration Toleration, taint Taint) bool { +func TolerationToleratesTaint(toleration *Toleration, taint *Taint) bool { if len(toleration.Effect) != 0 && toleration.Effect != taint.Effect { return false } @@ -486,10 +490,10 @@ func TolerationToleratesTaint(toleration Toleration, taint Taint) bool { } // TaintToleratedByTolerations checks if taint is tolerated by any of the tolerations. -func TaintToleratedByTolerations(taint Taint, tolerations []Toleration) bool { +func TaintToleratedByTolerations(taint *Taint, tolerations []Toleration) bool { tolerated := false - for _, toleration := range tolerations { - if TolerationToleratesTaint(toleration, taint) { + for i := range tolerations { + if TolerationToleratesTaint(&tolerations[i], taint) { tolerated = true break } diff --git a/vendor/k8s.io/kubernetes/pkg/api/install/install.go b/vendor/k8s.io/kubernetes/pkg/api/install/install.go index bed5f0791..937920d28 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/api/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/mapper.go b/vendor/k8s.io/kubernetes/pkg/api/mapper.go index 0216771ee..60addca7f 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/mapper.go +++ b/vendor/k8s.io/kubernetes/pkg/api/mapper.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta.go b/vendor/k8s.io/kubernetes/pkg/api/meta.go index 9d5dae2c5..77793593c 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/doc.go b/vendor/k8s.io/kubernetes/pkg/api/meta/doc.go index 4a132184f..a3b18a5c9 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/errors.go b/vendor/k8s.io/kubernetes/pkg/api/meta/errors.go index 2b89bcb8a..dc4ec07a3 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/errors.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/errors.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/help.go b/vendor/k8s.io/kubernetes/pkg/api/meta/help.go index cdc07930f..0d733a58a 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/help.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/help.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/interfaces.go b/vendor/k8s.io/kubernetes/pkg/api/meta/interfaces.go index 286bdc0dd..34c51e39b 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/interfaces.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/meta.go b/vendor/k8s.io/kubernetes/pkg/api/meta/meta.go index 5f185f39f..876aa4faa 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/meta.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/meta.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -29,104 +29,66 @@ import ( "github.com/golang/glog" ) +// errNotList is returned when an object implements the Object style interfaces but not the List style +// interfaces. +var errNotList = fmt.Errorf("object does not implement the List interfaces") + +// ListAccessor returns a List interface for the provided object or an error if the object does +// not provide List. +// IMPORTANT: Objects are a superset of lists, so all Objects return List metadata. Do not use this +// check to determine whether an object *is* a List. +// TODO: return bool instead of error func ListAccessor(obj interface{}) (List, error) { - if listMetaAccessor, ok := obj.(ListMetaAccessor); ok { - if om := listMetaAccessor.GetListMeta(); om != nil { - return om, nil + switch t := obj.(type) { + case List: + return t, nil + case unversioned.List: + return t, nil + case ListMetaAccessor: + if m := t.GetListMeta(); m != nil { + return m, nil } - } - if listMetaAccessor, ok := obj.(unversioned.ListMetaAccessor); ok { - if om := listMetaAccessor.GetListMeta(); om != nil { - return om, nil + return nil, errNotList + case unversioned.ListMetaAccessor: + if m := t.GetListMeta(); m != nil { + return m, nil } - } - // we may get passed an object that is directly portable to List - if list, ok := obj.(List); ok { - return list, nil - } - glog.V(4).Infof("Calling ListAccessor on non-internal object: %v", reflect.TypeOf(obj)) - // legacy path for objects that do not implement List and ListMetaAccessor via - // reflection - very slow code path. - v, err := conversion.EnforcePtr(obj) - if err != nil { - return nil, err - } - t := v.Type() - if v.Kind() != reflect.Struct { - return nil, fmt.Errorf("expected struct, but got %v: %v (%#v)", v.Kind(), t, v.Interface()) - } - a := &genericAccessor{} - listMeta := v.FieldByName("ListMeta") - if listMeta.IsValid() { - // look for the ListMeta fields - if err := extractFromListMeta(listMeta, a); err != nil { - return nil, fmt.Errorf("unable to find list fields on %#v: %v", listMeta, err) + return nil, errNotList + case Object: + return t, nil + case ObjectMetaAccessor: + if m := t.GetObjectMeta(); m != nil { + return m, nil } - } else { - return nil, fmt.Errorf("unable to find listMeta on %#v", v) + return nil, errNotList + default: + return nil, errNotList } - return a, nil } +// errNotObject is returned when an object implements the List style interfaces but not the Object style +// interfaces. +var errNotObject = fmt.Errorf("object does not implement the Object interfaces") + // Accessor takes an arbitrary object pointer and returns meta.Interface. // obj must be a pointer to an API type. An error is returned if the minimum // required fields are missing. Fields that are not required return the default // value and are a no-op if set. +// TODO: return bool instead of error func Accessor(obj interface{}) (Object, error) { - if objectMetaAccessor, ok := obj.(ObjectMetaAccessor); ok { - if om := objectMetaAccessor.GetObjectMeta(); om != nil { - return om, nil + switch t := obj.(type) { + case Object: + return t, nil + case ObjectMetaAccessor: + if m := t.GetObjectMeta(); m != nil { + return m, nil } + return nil, errNotObject + case List, unversioned.List, ListMetaAccessor, unversioned.ListMetaAccessor: + return nil, errNotObject + default: + return nil, errNotObject } - // we may get passed an object that is directly portable to Object - if object, ok := obj.(Object); ok { - return object, nil - } - - glog.V(4).Infof("Calling Accessor on non-internal object: %v", reflect.TypeOf(obj)) - // legacy path for objects that do not implement Object and ObjectMetaAccessor via - // reflection - very slow code path. - v, err := conversion.EnforcePtr(obj) - if err != nil { - return nil, err - } - t := v.Type() - if v.Kind() != reflect.Struct { - return nil, fmt.Errorf("expected struct, but got %v: %v (%#v)", v.Kind(), t, v.Interface()) - } - - typeMeta := v.FieldByName("TypeMeta") - if !typeMeta.IsValid() { - return nil, fmt.Errorf("struct %v lacks embedded TypeMeta type", t) - } - - a := &genericAccessor{} - if err := extractFromTypeMeta(typeMeta, a); err != nil { - return nil, fmt.Errorf("unable to find type fields on %#v: %v", typeMeta, err) - } - - objectMeta := v.FieldByName("ObjectMeta") - if objectMeta.IsValid() { - // look for the ObjectMeta fields - if err := extractFromObjectMeta(objectMeta, a); err != nil { - return nil, fmt.Errorf("unable to find object fields on %#v: %v", objectMeta, err) - } - } else { - listMeta := v.FieldByName("ListMeta") - if listMeta.IsValid() { - // look for the ListMeta fields - if err := extractFromListMeta(listMeta, a); err != nil { - return nil, fmt.Errorf("unable to find list fields on %#v: %v", listMeta, err) - } - } else { - // look for the older TypeMeta with all metadata - if err := extractFromObjectMeta(typeMeta, a); err != nil { - return nil, fmt.Errorf("unable to find object fields on %#v: %v", typeMeta, err) - } - } - } - - return a, nil } // TypeAccessor returns an interface that allows retrieving and modifying the APIVersion @@ -283,7 +245,7 @@ func (resourceAccessor) SetUID(obj runtime.Object, uid types.UID) error { } func (resourceAccessor) SelfLink(obj runtime.Object) (string, error) { - accessor, err := Accessor(obj) + accessor, err := ListAccessor(obj) if err != nil { return "", err } @@ -291,7 +253,7 @@ func (resourceAccessor) SelfLink(obj runtime.Object) (string, error) { } func (resourceAccessor) SetSelfLink(obj runtime.Object, selfLink string) error { - accessor, err := Accessor(obj) + accessor, err := ListAccessor(obj) if err != nil { return err } @@ -334,7 +296,7 @@ func (resourceAccessor) SetAnnotations(obj runtime.Object, annotations map[strin } func (resourceAccessor) ResourceVersion(obj runtime.Object) (string, error) { - accessor, err := Accessor(obj) + accessor, err := ListAccessor(obj) if err != nil { return "", err } @@ -342,7 +304,7 @@ func (resourceAccessor) ResourceVersion(obj runtime.Object) (string, error) { } func (resourceAccessor) SetResourceVersion(obj runtime.Object, version string) error { - accessor, err := Accessor(obj) + accessor, err := ListAccessor(obj) if err != nil { return err } @@ -603,54 +565,3 @@ func extractFromTypeMeta(v reflect.Value, a *genericAccessor) error { } return nil } - -// extractFromObjectMeta extracts pointers to metadata fields from an object -func extractFromObjectMeta(v reflect.Value, a *genericAccessor) error { - if err := runtime.FieldPtr(v, "Namespace", &a.namespace); err != nil { - return err - } - if err := runtime.FieldPtr(v, "Name", &a.name); err != nil { - return err - } - if err := runtime.FieldPtr(v, "GenerateName", &a.generateName); err != nil { - return err - } - if err := runtime.FieldPtr(v, "UID", &a.uid); err != nil { - return err - } - if err := runtime.FieldPtr(v, "ResourceVersion", &a.resourceVersion); err != nil { - return err - } - if err := runtime.FieldPtr(v, "SelfLink", &a.selfLink); err != nil { - return err - } - if err := runtime.FieldPtr(v, "Labels", &a.labels); err != nil { - return err - } - if err := runtime.FieldPtr(v, "Annotations", &a.annotations); err != nil { - return err - } - if err := runtime.FieldPtr(v, "Finalizers", &a.finalizers); err != nil { - return err - } - ownerReferences := v.FieldByName("OwnerReferences") - if !ownerReferences.IsValid() { - return fmt.Errorf("struct %#v lacks OwnerReferences type", v) - } - if ownerReferences.Kind() != reflect.Slice { - return fmt.Errorf("expect %v to be a slice", ownerReferences.Kind()) - } - a.ownerReferences = ownerReferences.Addr() - return nil -} - -// extractFromObjectMeta extracts pointers to metadata fields from a list object -func extractFromListMeta(v reflect.Value, a *genericAccessor) error { - if err := runtime.FieldPtr(v, "ResourceVersion", &a.resourceVersion); err != nil { - return err - } - if err := runtime.FieldPtr(v, "SelfLink", &a.selfLink); err != nil { - return err - } - return nil -} diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/metatypes/types.go b/vendor/k8s.io/kubernetes/pkg/api/meta/metatypes/types.go index e7ac3e08d..41e6596d7 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/metatypes/types.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/metatypes/types.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/multirestmapper.go b/vendor/k8s.io/kubernetes/pkg/api/meta/multirestmapper.go index b720f8fa2..790795a28 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/multirestmapper.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/multirestmapper.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/priority.go b/vendor/k8s.io/kubernetes/pkg/api/meta/priority.go index 24f38f78f..1e44e45f6 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/priority.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/priority.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/meta/restmapper.go b/vendor/k8s.io/kubernetes/pkg/api/meta/restmapper.go index 4e07ab741..bf2567ea6 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/meta/restmapper.go +++ b/vendor/k8s.io/kubernetes/pkg/api/meta/restmapper.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/pod/util.go b/vendor/k8s.io/kubernetes/pkg/api/pod/util.go index 1bdacfe20..cd6f9fb67 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/pod/util.go +++ b/vendor/k8s.io/kubernetes/pkg/api/pod/util.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/ref.go b/vendor/k8s.io/kubernetes/pkg/api/ref.go index 08dede071..b864593a0 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/ref.go +++ b/vendor/k8s.io/kubernetes/pkg/api/ref.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -45,10 +45,6 @@ func GetReference(obj runtime.Object) (*ObjectReference, error) { // Don't make a reference to a reference. return ref, nil } - meta, err := meta.Accessor(obj) - if err != nil { - return nil, err - } gvk := obj.GetObjectKind().GroupVersionKind() @@ -64,10 +60,22 @@ func GetReference(obj runtime.Object) (*ObjectReference, error) { kind = gvks[0].Kind } + // An object that implements only List has enough metadata to build a reference + var listMeta meta.List + objectMeta, err := meta.Accessor(obj) + if err != nil { + listMeta, err = meta.ListAccessor(obj) + if err != nil { + return nil, err + } + } else { + listMeta = objectMeta + } + // if the object referenced is actually persisted, we can also get version from meta version := gvk.GroupVersion().String() if len(version) == 0 { - selfLink := meta.GetSelfLink() + selfLink := listMeta.GetSelfLink() if len(selfLink) == 0 { return nil, ErrNoSelfLink } @@ -83,13 +91,22 @@ func GetReference(obj runtime.Object) (*ObjectReference, error) { version = parts[2] } + // only has list metadata + if objectMeta == nil { + return &ObjectReference{ + Kind: kind, + APIVersion: version, + ResourceVersion: listMeta.GetResourceVersion(), + }, nil + } + return &ObjectReference{ Kind: kind, APIVersion: version, - Name: meta.GetName(), - Namespace: meta.GetNamespace(), - UID: meta.GetUID(), - ResourceVersion: meta.GetResourceVersion(), + Name: objectMeta.GetName(), + Namespace: objectMeta.GetNamespace(), + UID: objectMeta.GetUID(), + ResourceVersion: objectMeta.GetResourceVersion(), }, nil } diff --git a/vendor/k8s.io/kubernetes/pkg/api/register.go b/vendor/k8s.io/kubernetes/pkg/api/register.go index 631a7f958..6b1ed7575 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/register.go +++ b/vendor/k8s.io/kubernetes/pkg/api/register.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/requestcontext.go b/vendor/k8s.io/kubernetes/pkg/api/requestcontext.go index 2c27d6862..14983b2d4 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/requestcontext.go +++ b/vendor/k8s.io/kubernetes/pkg/api/requestcontext.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/amount.go b/vendor/k8s.io/kubernetes/pkg/api/resource/amount.go index 6ae823a02..2d3012c87 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/amount.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/amount.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/api/resource/generated.pb.go index cf9447a32..f091cdeef 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/generated.proto b/vendor/k8s.io/kubernetes/pkg/api/resource/generated.proto index e1c2a3d60..bdc091d98 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -83,7 +83,6 @@ option go_package = "resource"; // writing some sort of special handling code in the hopes that that will // cause implementors to also use a fixed point implementation. // -// +gencopy=false // +protobuf=true // +protobuf.embed=string // +protobuf.options.marshal=false diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/math.go b/vendor/k8s.io/kubernetes/pkg/api/resource/math.go index 163aafa5d..887ac74c9 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/math.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/math.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/quantity.go b/vendor/k8s.io/kubernetes/pkg/api/resource/quantity.go index 96877b4c9..823dd5ef7 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/quantity.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/quantity.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -87,7 +87,6 @@ import ( // writing some sort of special handling code in the hopes that that will // cause implementors to also use a fixed point implementation. // -// +gencopy=false // +protobuf=true // +protobuf.embed=string // +protobuf.options.marshal=false @@ -386,6 +385,16 @@ func ParseQuantity(str string) (Quantity, error) { return Quantity{d: infDecAmount{amount}, Format: format}, nil } +// DeepCopy returns a deep-copy of the Quantity value. Note that the method +// receiver is a value, so we can mutate it in-place and return it. +func (q Quantity) DeepCopy() Quantity { + if q.d.Dec != nil { + tmp := &inf.Dec{} + q.d.Dec = tmp.Set(q.d.Dec) + } + return q +} + // CanonicalizeBytes returns the canonical form of q and its suffix (see comment on Quantity). // // Note about BinarySI: diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/quantity_proto.go b/vendor/k8s.io/kubernetes/pkg/api/resource/quantity_proto.go index 240294682..74dfb4e4b 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/quantity_proto.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/quantity_proto.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/scale_int.go b/vendor/k8s.io/kubernetes/pkg/api/resource/scale_int.go index 173de1a21..55e177b0e 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/scale_int.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/scale_int.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/suffix.go b/vendor/k8s.io/kubernetes/pkg/api/resource/suffix.go index 0aa2ce2bf..5ed7abe66 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/suffix.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource/suffix.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource_helpers.go b/vendor/k8s.io/kubernetes/pkg/api/resource_helpers.go index 4c55b120e..2c683daa1 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource_helpers.go +++ b/vendor/k8s.io/kubernetes/pkg/api/resource_helpers.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/rest/create.go b/vendor/k8s.io/kubernetes/pkg/api/rest/create.go index fa95b7f93..e7a521cb2 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/rest/create.go +++ b/vendor/k8s.io/kubernetes/pkg/api/rest/create.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/rest/delete.go b/vendor/k8s.io/kubernetes/pkg/api/rest/delete.go index 34965d52f..6967acbd1 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/rest/delete.go +++ b/vendor/k8s.io/kubernetes/pkg/api/rest/delete.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -44,7 +44,8 @@ type RESTGracefulDeleteStrategy interface { // should be gracefully deleted, if gracefulPending is set the object has already been gracefully deleted // (and the provided grace period is longer than the time to deletion), and an error is returned if the // condition cannot be checked or the gracePeriodSeconds is invalid. The options argument may be updated with -// default values if graceful is true. +// default values if graceful is true. Second place where we set deletionTimestamp is pkg/registry/generic/registry/store.go +// this function is responsible for setting deletionTimestamp during gracefulDeletion, other one for cascading deletions. func BeforeDelete(strategy RESTDeleteStrategy, ctx api.Context, obj runtime.Object, options *api.DeleteOptions) (graceful, gracefulPending bool, err error) { objectMeta, gvk, kerr := objectMetaAndKind(strategy, obj) if kerr != nil { @@ -56,9 +57,11 @@ func BeforeDelete(strategy RESTDeleteStrategy, ctx api.Context, obj runtime.Obje } gracefulStrategy, ok := strategy.(RESTGracefulDeleteStrategy) if !ok { + // If we're not deleting gracefully there's no point in updating Generation, as we won't update + // the obcject before deleting it. return false, false, nil } - // if the object is already being deleted + // if the object is already being deleted, no need to update generation. if objectMeta.DeletionTimestamp != nil { // if we are already being deleted, we may only shorten the deletion grace period // this means the object was gracefully deleted previously but deletionGracePeriodSeconds was not set, @@ -69,13 +72,14 @@ func BeforeDelete(strategy RESTDeleteStrategy, ctx api.Context, obj runtime.Obje // only a shorter grace period may be provided by a user if options.GracePeriodSeconds != nil { period := int64(*options.GracePeriodSeconds) - if period > *objectMeta.DeletionGracePeriodSeconds { + if period >= *objectMeta.DeletionGracePeriodSeconds { return false, true, nil } - now := unversioned.NewTime(unversioned.Now().Add(time.Second * time.Duration(*options.GracePeriodSeconds))) - objectMeta.DeletionTimestamp = &now + newDeletionTimestamp := unversioned.NewTime( + objectMeta.DeletionTimestamp.Add(-time.Second * time.Duration(*objectMeta.DeletionGracePeriodSeconds)). + Add(time.Second * time.Duration(*options.GracePeriodSeconds))) + objectMeta.DeletionTimestamp = &newDeletionTimestamp objectMeta.DeletionGracePeriodSeconds = &period - options.GracePeriodSeconds = &period return true, false, nil } // graceful deletion is pending, do nothing @@ -89,5 +93,12 @@ func BeforeDelete(strategy RESTDeleteStrategy, ctx api.Context, obj runtime.Obje now := unversioned.NewTime(unversioned.Now().Add(time.Second * time.Duration(*options.GracePeriodSeconds))) objectMeta.DeletionTimestamp = &now objectMeta.DeletionGracePeriodSeconds = options.GracePeriodSeconds + // If it's the first graceful deletion we are going to set the DeletionTimestamp to non-nil. + // Controllers of the object that's being deleted shouldn't take any nontrivial actions, hence its behavior changes. + // Thus we need to bump object's Generation (if set). This handles generation bump during graceful deletion. + // The bump for objects that don't support graceful deletion is handled in pkg/registry/generic/registry/store.go. + if objectMeta.Generation > 0 { + objectMeta.Generation++ + } return true, false, nil } diff --git a/vendor/k8s.io/kubernetes/pkg/api/rest/doc.go b/vendor/k8s.io/kubernetes/pkg/api/rest/doc.go index 8fed0e9f4..ee7c4145f 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/rest/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/api/rest/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/rest/export.go b/vendor/k8s.io/kubernetes/pkg/api/rest/export.go index e12f65de3..4407da79a 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/rest/export.go +++ b/vendor/k8s.io/kubernetes/pkg/api/rest/export.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/rest/rest.go b/vendor/k8s.io/kubernetes/pkg/api/rest/rest.go index 4d5b5ba97..2d90c2f53 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/rest/rest.go +++ b/vendor/k8s.io/kubernetes/pkg/api/rest/rest.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/rest/types.go b/vendor/k8s.io/kubernetes/pkg/api/rest/types.go index 0e7f048ba..85e786465 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/rest/types.go +++ b/vendor/k8s.io/kubernetes/pkg/api/rest/types.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/rest/update.go b/vendor/k8s.io/kubernetes/pkg/api/rest/update.go index bc5ed0c5f..68cccb213 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/rest/update.go +++ b/vendor/k8s.io/kubernetes/pkg/api/rest/update.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -86,6 +86,12 @@ func BeforeUpdate(strategy RESTUpdateStrategy, ctx api.Context, obj, old runtime } else { objectMeta.Namespace = api.NamespaceNone } + // Ensure requests cannot update generation + oldMeta, err := api.ObjectMetaFor(old) + if err != nil { + return err + } + objectMeta.Generation = oldMeta.Generation strategy.PrepareForUpdate(obj, old) @@ -173,3 +179,44 @@ func (i *defaultUpdatedObjectInfo) UpdatedObject(ctx api.Context, oldObj runtime return newObj, nil } + +// wrappedUpdatedObjectInfo allows wrapping an existing objInfo and +// chaining additional transformations/checks on the result of UpdatedObject() +type wrappedUpdatedObjectInfo struct { + // obj is the updated object + objInfo UpdatedObjectInfo + + // transformers is an optional list of transforming functions that modify or + // replace obj using information from the context, old object, or other sources. + transformers []TransformFunc +} + +// WrapUpdatedObjectInfo returns an UpdatedObjectInfo impl that delegates to +// the specified objInfo, then calls the passed transformers +func WrapUpdatedObjectInfo(objInfo UpdatedObjectInfo, transformers ...TransformFunc) UpdatedObjectInfo { + return &wrappedUpdatedObjectInfo{objInfo, transformers} +} + +// Preconditions satisfies the UpdatedObjectInfo interface. +func (i *wrappedUpdatedObjectInfo) Preconditions() *api.Preconditions { + return i.objInfo.Preconditions() +} + +// UpdatedObject satisfies the UpdatedObjectInfo interface. +// It delegates to the wrapped objInfo and passes the result through any configured transformers. +func (i *wrappedUpdatedObjectInfo) UpdatedObject(ctx api.Context, oldObj runtime.Object) (runtime.Object, error) { + newObj, err := i.objInfo.UpdatedObject(ctx, oldObj) + if err != nil { + return newObj, err + } + + // Allow any configured transformers to update the new object or error + for _, transformer := range i.transformers { + newObj, err = transformer(ctx, newObj, oldObj) + if err != nil { + return nil, err + } + } + + return newObj, nil +} diff --git a/vendor/k8s.io/kubernetes/pkg/api/service/annotations.go b/vendor/k8s.io/kubernetes/pkg/api/service/annotations.go index 9d57fa4c2..ee275d3c1 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/service/annotations.go +++ b/vendor/k8s.io/kubernetes/pkg/api/service/annotations.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/service/util.go b/vendor/k8s.io/kubernetes/pkg/api/service/util.go index b6611d237..6f0e14e2b 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/service/util.go +++ b/vendor/k8s.io/kubernetes/pkg/api/service/util.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/testapi/testapi.go b/vendor/k8s.io/kubernetes/pkg/api/testapi/testapi.go index 518dddbff..f58e1c61f 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/testapi/testapi.go +++ b/vendor/k8s.io/kubernetes/pkg/api/testapi/testapi.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -32,6 +32,7 @@ import ( "k8s.io/kubernetes/pkg/apis/apps" "k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/batch" + "k8s.io/kubernetes/pkg/apis/certificates" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/policy" "k8s.io/kubernetes/pkg/apis/rbac" @@ -43,6 +44,7 @@ import ( _ "k8s.io/kubernetes/pkg/apis/apps/install" _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" _ "k8s.io/kubernetes/pkg/apis/batch/install" + _ "k8s.io/kubernetes/pkg/apis/certificates/install" _ "k8s.io/kubernetes/pkg/apis/componentconfig/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install" _ "k8s.io/kubernetes/pkg/apis/policy/install" @@ -50,15 +52,16 @@ import ( ) var ( - Groups = make(map[string]TestGroup) - Default TestGroup - Autoscaling TestGroup - Batch TestGroup - Extensions TestGroup - Apps TestGroup - Policy TestGroup - Federation TestGroup - Rbac TestGroup + Groups = make(map[string]TestGroup) + Default TestGroup + Autoscaling TestGroup + Batch TestGroup + Extensions TestGroup + Apps TestGroup + Policy TestGroup + Federation TestGroup + Rbac TestGroup + Certificates TestGroup serializer runtime.SerializerInfo storageSerializer runtime.SerializerInfo @@ -190,12 +193,20 @@ func init() { internalTypes: api.Scheme.KnownTypes(rbac.SchemeGroupVersion), } } + if _, ok := Groups[certificates.GroupName]; !ok { + Groups[certificates.GroupName] = TestGroup{ + externalGroupVersion: unversioned.GroupVersion{Group: certificates.GroupName, Version: registered.GroupOrDie(certificates.GroupName).GroupVersion.Version}, + internalGroupVersion: certificates.SchemeGroupVersion, + internalTypes: api.Scheme.KnownTypes(certificates.SchemeGroupVersion), + } + } Default = Groups[api.GroupName] Autoscaling = Groups[autoscaling.GroupName] Batch = Groups[batch.GroupName] Apps = Groups[apps.GroupName] Policy = Groups[policy.GroupName] + Certificates = Groups[certificates.GroupName] Extensions = Groups[extensions.GroupName] Federation = Groups[federation.GroupName] Rbac = Groups[rbac.GroupName] diff --git a/vendor/k8s.io/kubernetes/pkg/api/types.generated.go b/vendor/k8s.io/kubernetes/pkg/api/types.generated.go index b2dcd4afb..67d3dbc27 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/types.go b/vendor/k8s.io/kubernetes/pkg/api/types.go index 6d11c183b..7225e8fa8 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/types.go +++ b/vendor/k8s.io/kubernetes/pkg/api/types.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -283,7 +283,8 @@ type PersistentVolumeClaimVolumeSource struct { ReadOnly bool `json:"readOnly,omitempty"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true type PersistentVolume struct { unversioned.TypeMeta `json:",inline"` @@ -440,7 +441,7 @@ type HostPathVolumeSource struct { type EmptyDirVolumeSource struct { // TODO: Longer term we want to represent the selection of underlying // media more like a scheduling problem - user says what traits they - // need, we give them a backing store that satisifies that. For now + // need, we give them a backing store that satisfies that. For now // this will cover the most common needs. // Optional: what type of storage medium should back this directory. // The default is "" which means to use the node's default medium. @@ -1478,12 +1479,15 @@ type PodSecurityContext struct { // Use the host's network namespace. If this option is set, the ports that will be // used must be specified. // Optional: Default to false + // +k8s:conversion-gen=false HostNetwork bool `json:"hostNetwork,omitempty"` // Use the host's pid namespace. // Optional: Default to false. + // +k8s:conversion-gen=false HostPID bool `json:"hostPID,omitempty"` // Use the host's ipc namespace. // Optional: Default to false. + // +k8s:conversion-gen=false HostIPC bool `json:"hostIPC,omitempty"` // The SELinux context to be applied to all containers. // If unspecified, the container runtime will allocate a random SELinux context for each @@ -2000,7 +2004,7 @@ type AttachedVolume struct { // Name of the attached volume Name UniqueVolumeName `json:"name"` - // DevicePath represents the device path where the volume should be avilable + // DevicePath represents the device path where the volume should be available DevicePath string `json:"devicePath"` } @@ -2096,7 +2100,8 @@ const ( // ResourceList is a set of (resource name, quantity) pairs. type ResourceList map[ResourceName]resource.Quantity -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // Node is a worker node in Kubernetes // The name of the node according to etcd is in ObjectMeta.Name. @@ -2149,7 +2154,8 @@ const ( NamespaceTerminating NamespacePhase = "Terminating" ) -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // A namespace provides a scope for Names. // Use of multiple namespaces is optional @@ -2686,7 +2692,7 @@ const ( // TODO: Consider supporting different formats, specifying CA/destinationCA. SecretTypeTLS SecretType = "kubernetes.io/tls" - // TLSCertKey is the key for tls certificates in a TLS secert. + // TLSCertKey is the key for tls certificates in a TLS secret. TLSCertKey = "tls.crt" // TLSPrivateKeyKey is the key for the private key field in a TLS secret. TLSPrivateKeyKey = "tls.key" @@ -2785,7 +2791,8 @@ type ComponentCondition struct { Error string `json:"error,omitempty"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // ComponentStatus (and ComponentStatusList) holds the cluster validation info. type ComponentStatus struct { diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/deep_copy_generated.go index ff8f1f0d6..77f5b66d8 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,31 +26,23 @@ import ( ) func DeepCopy_unversioned_APIGroup(in APIGroup, out *APIGroup, c *conversion.Cloner) error { - if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Name = in.Name if in.Versions != nil { in, out := in.Versions, &out.Versions *out = make([]GroupVersionForDiscovery, len(in)) for i := range in { - if err := DeepCopy_unversioned_GroupVersionForDiscovery(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Versions = nil } - if err := DeepCopy_unversioned_GroupVersionForDiscovery(in.PreferredVersion, &out.PreferredVersion, c); err != nil { - return err - } + out.PreferredVersion = in.PreferredVersion if in.ServerAddressByClientCIDRs != nil { in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs *out = make([]ServerAddressByClientCIDR, len(in)) for i := range in { - if err := DeepCopy_unversioned_ServerAddressByClientCIDR(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.ServerAddressByClientCIDRs = nil @@ -59,9 +51,7 @@ func DeepCopy_unversioned_APIGroup(in APIGroup, out *APIGroup, c *conversion.Clo } func DeepCopy_unversioned_APIGroupList(in APIGroupList, out *APIGroupList, c *conversion.Cloner) error { - if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if in.Groups != nil { in, out := in.Groups, &out.Groups *out = make([]APIGroup, len(in)) @@ -84,17 +74,13 @@ func DeepCopy_unversioned_APIResource(in APIResource, out *APIResource, c *conve } func DeepCopy_unversioned_APIResourceList(in APIResourceList, out *APIResourceList, c *conversion.Cloner) error { - if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.GroupVersion = in.GroupVersion if in.APIResources != nil { in, out := in.APIResources, &out.APIResources *out = make([]APIResource, len(in)) for i := range in { - if err := DeepCopy_unversioned_APIResource(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.APIResources = nil @@ -103,9 +89,7 @@ func DeepCopy_unversioned_APIResourceList(in APIResourceList, out *APIResourceLi } func DeepCopy_unversioned_APIVersions(in APIVersions, out *APIVersions, c *conversion.Cloner) error { - if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if in.Versions != nil { in, out := in.Versions, &out.Versions *out = make([]string, len(in)) @@ -117,9 +101,7 @@ func DeepCopy_unversioned_APIVersions(in APIVersions, out *APIVersions, c *conve in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs *out = make([]ServerAddressByClientCIDR, len(in)) for i := range in { - if err := DeepCopy_unversioned_ServerAddressByClientCIDR(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.ServerAddressByClientCIDRs = nil @@ -133,9 +115,7 @@ func DeepCopy_unversioned_Duration(in Duration, out *Duration, c *conversion.Clo } func DeepCopy_unversioned_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error { - if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Export = in.Export out.Exact = in.Exact return nil @@ -244,12 +224,8 @@ func DeepCopy_unversioned_ServerAddressByClientCIDR(in ServerAddressByClientCIDR } func DeepCopy_unversioned_Status(in Status, out *Status, c *conversion.Cloner) error { - if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta out.Status = in.Status out.Message = in.Message out.Reason = in.Reason @@ -281,9 +257,7 @@ func DeepCopy_unversioned_StatusDetails(in StatusDetails, out *StatusDetails, c in, out := in.Causes, &out.Causes *out = make([]StatusCause, len(in)) for i := range in { - if err := DeepCopy_unversioned_StatusCause(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Causes = nil diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/doc.go new file mode 100644 index 000000000..d0ffc3327 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package + +package unversioned diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/duration.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/duration.go index cdaf25730..ed54e515d 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/duration.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/duration.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.pb.go index cb9803552..f0d714717 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.proto b/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.proto index def4a6d6f..bb4bf4aa7 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/group_version.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/group_version.go index 167002c3f..8f7478921 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/group_version.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/group_version.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/helpers.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/helpers.go index b71297ec5..fbbff0019 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/helpers.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/helpers.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/meta.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/meta.go index b82b1990e..48009da16 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/meta.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/meta.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/register.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/register.go index f8dbd8371..9af056693 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/register.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/register.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/time.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/time.go index df94bbe72..73b00f2e7 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/time.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/time.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -33,6 +33,13 @@ type Time struct { time.Time `protobuf:"-"` } +// DeepCopy returns a deep-copy of the Time value. The underlying time.Time +// type is effectively immutable in the time API, so it is safe to +// copy-by-assign, despite the presence of (unexported) Pointer fields. +func (t Time) DeepCopy() Time { + return t +} + // NewTime returns a wrapped instance of the provided time func NewTime(time time.Time) Time { return Time{time} diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/time_proto.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/time_proto.go index 496d5d98c..ba25e9164 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/time_proto.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/time_proto.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/types.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/types.go index 5006b2d0b..f3964874e 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/types.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/types_swagger_doc_generated.go index 8caef8e54..cdd31eb48 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/validation/validation.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/validation/validation.go index 47852e3e2..ecb968bdc 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/validation/validation.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/validation/validation.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/unversioned/well_known_labels.go b/vendor/k8s.io/kubernetes/pkg/api/unversioned/well_known_labels.go index 08e4f6889..318c6eebf 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/unversioned/well_known_labels.go +++ b/vendor/k8s.io/kubernetes/pkg/api/unversioned/well_known_labels.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/util/group_version.go b/vendor/k8s.io/kubernetes/pkg/api/util/group_version.go index 0cee25023..fea2f17f8 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/util/group_version.go +++ b/vendor/k8s.io/kubernetes/pkg/api/util/group_version.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/conversion.go b/vendor/k8s.io/kubernetes/pkg/api/v1/conversion.go index 98d8b7ed2..642b1bc5e 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -43,6 +43,7 @@ func addConversionFuncs(scheme *runtime.Scheme) { Convert_v1_Pod_To_api_Pod, Convert_v1_PodSpec_To_api_PodSpec, Convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec, + Convert_v1_Secret_To_api_Secret, Convert_v1_ServiceSpec_To_api_ServiceSpec, Convert_v1_ResourceList_To_api_ResourceList, ) @@ -359,124 +360,34 @@ func Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out // The following two PodSpec conversions are done here to support ServiceAccount // as an alias for ServiceAccountName. func Convert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conversion.Scope) error { - if in.Volumes != nil { - out.Volumes = make([]Volume, len(in.Volumes)) - for i := range in.Volumes { - if err := Convert_api_Volume_To_v1_Volume(&in.Volumes[i], &out.Volumes[i], s); err != nil { - return err - } - } - } else { - out.Volumes = nil - } - if in.InitContainers != nil { - out.InitContainers = make([]Container, len(in.InitContainers)) - for i := range in.InitContainers { - if err := Convert_api_Container_To_v1_Container(&in.InitContainers[i], &out.InitContainers[i], s); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - out.Containers = make([]Container, len(in.Containers)) - for i := range in.Containers { - if err := Convert_api_Container_To_v1_Container(&in.Containers[i], &out.Containers[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil + if err := autoConvert_api_PodSpec_To_v1_PodSpec(in, out, s); err != nil { + return err } - out.RestartPolicy = RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.DNSPolicy = DNSPolicy(in.DNSPolicy) - out.NodeSelector = in.NodeSelector - - out.ServiceAccountName = in.ServiceAccountName // DeprecatedServiceAccount is an alias for ServiceAccountName. out.DeprecatedServiceAccount = in.ServiceAccountName - out.NodeName = in.NodeName - if in.SecurityContext != nil { - out.SecurityContext = new(PodSecurityContext) - if err := Convert_api_PodSecurityContext_To_v1_PodSecurityContext(in.SecurityContext, out.SecurityContext, s); err != nil { - return err - } + if in.SecurityContext != nil { // the host namespace fields have to be handled here for backward compatibility // with v1.0.0 out.HostPID = in.SecurityContext.HostPID out.HostNetwork = in.SecurityContext.HostNetwork out.HostIPC = in.SecurityContext.HostIPC } - if in.ImagePullSecrets != nil { - out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) - for i := range in.ImagePullSecrets { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&in.ImagePullSecrets[i], &out.ImagePullSecrets[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain + return nil } func Convert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conversion.Scope) error { - SetDefaults_PodSpec(in) - if in.Volumes != nil { - out.Volumes = make([]api.Volume, len(in.Volumes)) - for i := range in.Volumes { - if err := Convert_v1_Volume_To_api_Volume(&in.Volumes[i], &out.Volumes[i], s); err != nil { - return err - } - } - } else { - out.Volumes = nil + if err := autoConvert_v1_PodSpec_To_api_PodSpec(in, out, s); err != nil { + return err } - if in.InitContainers != nil { - out.InitContainers = make([]api.Container, len(in.InitContainers)) - for i := range in.InitContainers { - if err := Convert_v1_Container_To_api_Container(&in.InitContainers[i], &out.InitContainers[i], s); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - out.Containers = make([]api.Container, len(in.Containers)) - for i := range in.Containers { - if err := Convert_v1_Container_To_api_Container(&in.Containers[i], &out.Containers[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil - } - out.RestartPolicy = api.RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.DNSPolicy = api.DNSPolicy(in.DNSPolicy) - out.NodeSelector = in.NodeSelector + // We support DeprecatedServiceAccount as an alias for ServiceAccountName. // If both are specified, ServiceAccountName (the new field) wins. - out.ServiceAccountName = in.ServiceAccountName if in.ServiceAccountName == "" { out.ServiceAccountName = in.DeprecatedServiceAccount } - out.NodeName = in.NodeName - if in.SecurityContext != nil { - out.SecurityContext = new(api.PodSecurityContext) - if err := Convert_v1_PodSecurityContext_To_api_PodSecurityContext(in.SecurityContext, out.SecurityContext, s); err != nil { - return err - } - } // the host namespace fields have to be handled specially for backward compatibility // with v1.0.0 @@ -486,18 +397,7 @@ func Convert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conversi out.SecurityContext.HostNetwork = in.HostNetwork out.SecurityContext.HostPID = in.HostPID out.SecurityContext.HostIPC = in.HostIPC - if in.ImagePullSecrets != nil { - out.ImagePullSecrets = make([]api.LocalObjectReference, len(in.ImagePullSecrets)) - for i := range in.ImagePullSecrets { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.ImagePullSecrets[i], &out.ImagePullSecrets[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain + return nil } @@ -598,6 +498,24 @@ func Convert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *Service return nil } +func Convert_v1_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversion.Scope) error { + if err := autoConvert_v1_Secret_To_api_Secret(in, out, s); err != nil { + return err + } + + // StringData overwrites Data + if len(in.StringData) > 0 { + if out.Data == nil { + out.Data = map[string][]byte{} + } + for k, v := range in.StringData { + out.Data[k] = []byte(v) + } + } + + return nil +} + func Convert_v1_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.ServiceSpec, s conversion.Scope) error { if err := autoConvert_v1_ServiceSpec_To_api_ServiceSpec(in, out, s); err != nil { return err diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go index d3aad1552..a9cb349c0 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import ( resource "k8s.io/kubernetes/pkg/api/resource" conversion "k8s.io/kubernetes/pkg/conversion" runtime "k8s.io/kubernetes/pkg/runtime" + types "k8s.io/kubernetes/pkg/types" ) func init() { @@ -3593,7 +3594,7 @@ func autoConvert_v1_ObjectMeta_To_api_ObjectMeta(in *ObjectMeta, out *api.Object out.GenerateName = in.GenerateName out.Namespace = in.Namespace out.SelfLink = in.SelfLink - out.UID = in.UID + out.UID = types.UID(in.UID) out.ResourceVersion = in.ResourceVersion out.Generation = in.Generation if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.CreationTimestamp, &out.CreationTimestamp, s); err != nil { @@ -3627,7 +3628,7 @@ func autoConvert_api_ObjectMeta_To_v1_ObjectMeta(in *api.ObjectMeta, out *Object out.GenerateName = in.GenerateName out.Namespace = in.Namespace out.SelfLink = in.SelfLink - out.UID = in.UID + out.UID = types.UID(in.UID) out.ResourceVersion = in.ResourceVersion out.Generation = in.Generation if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.CreationTimestamp, &out.CreationTimestamp, s); err != nil { @@ -3660,7 +3661,7 @@ func autoConvert_v1_ObjectReference_To_api_ObjectReference(in *ObjectReference, out.Kind = in.Kind out.Namespace = in.Namespace out.Name = in.Name - out.UID = in.UID + out.UID = types.UID(in.UID) out.APIVersion = in.APIVersion out.ResourceVersion = in.ResourceVersion out.FieldPath = in.FieldPath @@ -3675,7 +3676,7 @@ func autoConvert_api_ObjectReference_To_v1_ObjectReference(in *api.ObjectReferen out.Kind = in.Kind out.Namespace = in.Namespace out.Name = in.Name - out.UID = in.UID + out.UID = types.UID(in.UID) out.APIVersion = in.APIVersion out.ResourceVersion = in.ResourceVersion out.FieldPath = in.FieldPath @@ -3690,7 +3691,7 @@ func autoConvert_v1_OwnerReference_To_api_OwnerReference(in *OwnerReference, out out.APIVersion = in.APIVersion out.Kind = in.Kind out.Name = in.Name - out.UID = in.UID + out.UID = types.UID(in.UID) out.Controller = in.Controller return nil } @@ -3703,7 +3704,7 @@ func autoConvert_api_OwnerReference_To_v1_OwnerReference(in *api.OwnerReference, out.APIVersion = in.APIVersion out.Kind = in.Kind out.Name = in.Name - out.UID = in.UID + out.UID = types.UID(in.UID) out.Controller = in.Controller return nil } @@ -4784,6 +4785,90 @@ func autoConvert_v1_PodSecurityContext_To_api_PodSecurityContext(in *PodSecurity return nil } +func autoConvert_api_PodSecurityContext_To_v1_PodSecurityContext(in *api.PodSecurityContext, out *PodSecurityContext, s conversion.Scope) error { + if in.SELinuxOptions != nil { + in, out := &in.SELinuxOptions, &out.SELinuxOptions + *out = new(SELinuxOptions) + if err := Convert_api_SELinuxOptions_To_v1_SELinuxOptions(*in, *out, s); err != nil { + return err + } + } else { + out.SELinuxOptions = nil + } + out.RunAsUser = in.RunAsUser + out.RunAsNonRoot = in.RunAsNonRoot + out.SupplementalGroups = in.SupplementalGroups + out.FSGroup = in.FSGroup + return nil +} + +func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conversion.Scope) error { + SetDefaults_PodSpec(in) + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]api.Volume, len(*in)) + for i := range *in { + if err := Convert_v1_Volume_To_api_Volume(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Volumes = nil + } + if in.InitContainers != nil { + in, out := &in.InitContainers, &out.InitContainers + *out = make([]api.Container, len(*in)) + for i := range *in { + if err := Convert_v1_Container_To_api_Container(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.InitContainers = nil + } + if in.Containers != nil { + in, out := &in.Containers, &out.Containers + *out = make([]api.Container, len(*in)) + for i := range *in { + if err := Convert_v1_Container_To_api_Container(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Containers = nil + } + out.RestartPolicy = api.RestartPolicy(in.RestartPolicy) + out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds + out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds + out.DNSPolicy = api.DNSPolicy(in.DNSPolicy) + out.NodeSelector = in.NodeSelector + out.ServiceAccountName = in.ServiceAccountName + out.NodeName = in.NodeName + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(api.PodSecurityContext) + if err := Convert_v1_PodSecurityContext_To_api_PodSecurityContext(*in, *out, s); err != nil { + return err + } + } else { + out.SecurityContext = nil + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]api.LocalObjectReference, len(*in)) + for i := range *in { + if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.ImagePullSecrets = nil + } + out.Hostname = in.Hostname + out.Subdomain = in.Subdomain + return nil +} + func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conversion.Scope) error { if in.Volumes != nil { in, out := &in.Volumes, &out.Volumes @@ -5646,10 +5731,6 @@ func autoConvert_v1_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversi return nil } -func Convert_v1_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversion.Scope) error { - return autoConvert_v1_Secret_To_api_Secret(in, out, s) -} - func autoConvert_api_Secret_To_v1_Secret(in *api.Secret, out *Secret, s conversion.Scope) error { if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { return err diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/api/v1/deep_copy_generated.go index e7d59684a..9054da35e 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,12 +22,10 @@ package v1 import ( api "k8s.io/kubernetes/pkg/api" - resource "k8s.io/kubernetes/pkg/api/resource" unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" runtime "k8s.io/kubernetes/pkg/runtime" types "k8s.io/kubernetes/pkg/types" - intstr "k8s.io/kubernetes/pkg/util/intstr" ) func init() { @@ -240,15 +238,11 @@ func DeepCopy_v1_AzureFileVolumeSource(in AzureFileVolumeSource, out *AzureFileV } func DeepCopy_v1_Binding(in Binding, out *Binding, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_v1_ObjectReference(in.Target, &out.Target, c); err != nil { - return err - } + out.Target = in.Target return nil } @@ -288,9 +282,7 @@ func DeepCopy_v1_CephFSVolumeSource(in CephFSVolumeSource, out *CephFSVolumeSour if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(LocalObjectReference) - if err := DeepCopy_v1_LocalObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretRef = nil } @@ -314,9 +306,7 @@ func DeepCopy_v1_ComponentCondition(in ComponentCondition, out *ComponentConditi } func DeepCopy_v1_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -324,9 +314,7 @@ func DeepCopy_v1_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *co in, out := in.Conditions, &out.Conditions *out = make([]ComponentCondition, len(in)) for i := range in { - if err := DeepCopy_v1_ComponentCondition(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Conditions = nil @@ -335,12 +323,8 @@ func DeepCopy_v1_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *co } func DeepCopy_v1_ComponentStatusList(in ComponentStatusList, out *ComponentStatusList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ComponentStatus, len(in)) @@ -356,9 +340,7 @@ func DeepCopy_v1_ComponentStatusList(in ComponentStatusList, out *ComponentStatu } func DeepCopy_v1_ConfigMap(in ConfigMap, out *ConfigMap, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -375,20 +357,14 @@ func DeepCopy_v1_ConfigMap(in ConfigMap, out *ConfigMap, c *conversion.Cloner) e } func DeepCopy_v1_ConfigMapKeySelector(in ConfigMapKeySelector, out *ConfigMapKeySelector, c *conversion.Cloner) error { - if err := DeepCopy_v1_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { - return err - } + out.LocalObjectReference = in.LocalObjectReference out.Key = in.Key return nil } func DeepCopy_v1_ConfigMapList(in ConfigMapList, out *ConfigMapList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ConfigMap, len(in)) @@ -404,16 +380,12 @@ func DeepCopy_v1_ConfigMapList(in ConfigMapList, out *ConfigMapList, c *conversi } func DeepCopy_v1_ConfigMapVolumeSource(in ConfigMapVolumeSource, out *ConfigMapVolumeSource, c *conversion.Cloner) error { - if err := DeepCopy_v1_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { - return err - } + out.LocalObjectReference = in.LocalObjectReference if in.Items != nil { in, out := in.Items, &out.Items *out = make([]KeyToPath, len(in)) for i := range in { - if err := DeepCopy_v1_KeyToPath(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Items = nil @@ -443,9 +415,7 @@ func DeepCopy_v1_Container(in Container, out *Container, c *conversion.Cloner) e in, out := in.Ports, &out.Ports *out = make([]ContainerPort, len(in)) for i := range in { - if err := DeepCopy_v1_ContainerPort(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ports = nil @@ -468,9 +438,7 @@ func DeepCopy_v1_Container(in Container, out *Container, c *conversion.Cloner) e in, out := in.VolumeMounts, &out.VolumeMounts *out = make([]VolumeMount, len(in)) for i := range in { - if err := DeepCopy_v1_VolumeMount(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.VolumeMounts = nil @@ -544,9 +512,7 @@ func DeepCopy_v1_ContainerState(in ContainerState, out *ContainerState, c *conve if in.Waiting != nil { in, out := in.Waiting, &out.Waiting *out = new(ContainerStateWaiting) - if err := DeepCopy_v1_ContainerStateWaiting(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Waiting = nil } @@ -572,9 +538,7 @@ func DeepCopy_v1_ContainerState(in ContainerState, out *ContainerState, c *conve } func DeepCopy_v1_ContainerStateRunning(in ContainerStateRunning, out *ContainerStateRunning, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_Time(in.StartedAt, &out.StartedAt, c); err != nil { - return err - } + out.StartedAt = in.StartedAt.DeepCopy() return nil } @@ -583,12 +547,8 @@ func DeepCopy_v1_ContainerStateTerminated(in ContainerStateTerminated, out *Cont out.Signal = in.Signal out.Reason = in.Reason out.Message = in.Message - if err := unversioned.DeepCopy_unversioned_Time(in.StartedAt, &out.StartedAt, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.FinishedAt, &out.FinishedAt, c); err != nil { - return err - } + out.StartedAt = in.StartedAt.DeepCopy() + out.FinishedAt = in.FinishedAt.DeepCopy() out.ContainerID = in.ContainerID return nil } @@ -621,9 +581,7 @@ func DeepCopy_v1_DaemonEndpoint(in DaemonEndpoint, out *DaemonEndpoint, c *conve } func DeepCopy_v1_DeleteOptions(in DeleteOptions, out *DeleteOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if in.GracePeriodSeconds != nil { in, out := in.GracePeriodSeconds, &out.GracePeriodSeconds *out = new(int64) @@ -655,9 +613,7 @@ func DeepCopy_v1_DownwardAPIVolumeFile(in DownwardAPIVolumeFile, out *DownwardAP if in.FieldRef != nil { in, out := in.FieldRef, &out.FieldRef *out = new(ObjectFieldSelector) - if err := DeepCopy_v1_ObjectFieldSelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.FieldRef = nil } @@ -699,9 +655,7 @@ func DeepCopy_v1_EndpointAddress(in EndpointAddress, out *EndpointAddress, c *co if in.TargetRef != nil { in, out := in.TargetRef, &out.TargetRef *out = new(ObjectReference) - if err := DeepCopy_v1_ObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.TargetRef = nil } @@ -742,9 +696,7 @@ func DeepCopy_v1_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conve in, out := in.Ports, &out.Ports *out = make([]EndpointPort, len(in)) for i := range in { - if err := DeepCopy_v1_EndpointPort(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ports = nil @@ -753,9 +705,7 @@ func DeepCopy_v1_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conve } func DeepCopy_v1_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -774,12 +724,8 @@ func DeepCopy_v1_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) e } func DeepCopy_v1_EndpointsList(in EndpointsList, out *EndpointsList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Endpoints, len(in)) @@ -813,9 +759,7 @@ func DeepCopy_v1_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion. if in.FieldRef != nil { in, out := in.FieldRef, &out.FieldRef *out = new(ObjectFieldSelector) - if err := DeepCopy_v1_ObjectFieldSelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.FieldRef = nil } @@ -831,18 +775,14 @@ func DeepCopy_v1_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion. if in.ConfigMapKeyRef != nil { in, out := in.ConfigMapKeyRef, &out.ConfigMapKeyRef *out = new(ConfigMapKeySelector) - if err := DeepCopy_v1_ConfigMapKeySelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ConfigMapKeyRef = nil } if in.SecretKeyRef != nil { in, out := in.SecretKeyRef, &out.SecretKeyRef *out = new(SecretKeySelector) - if err := DeepCopy_v1_SecretKeySelector(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretKeyRef = nil } @@ -850,38 +790,24 @@ func DeepCopy_v1_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion. } func DeepCopy_v1_Event(in Event, out *Event, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_v1_ObjectReference(in.InvolvedObject, &out.InvolvedObject, c); err != nil { - return err - } + out.InvolvedObject = in.InvolvedObject out.Reason = in.Reason out.Message = in.Message - if err := DeepCopy_v1_EventSource(in.Source, &out.Source, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.FirstTimestamp, &out.FirstTimestamp, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTimestamp, &out.LastTimestamp, c); err != nil { - return err - } + out.Source = in.Source + out.FirstTimestamp = in.FirstTimestamp.DeepCopy() + out.LastTimestamp = in.LastTimestamp.DeepCopy() out.Count = in.Count out.Type = in.Type return nil } func DeepCopy_v1_EventList(in EventList, out *EventList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Event, len(in)) @@ -914,9 +840,7 @@ func DeepCopy_v1_ExecAction(in ExecAction, out *ExecAction, c *conversion.Cloner } func DeepCopy_v1_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Export = in.Export out.Exact = in.Exact return nil @@ -948,9 +872,7 @@ func DeepCopy_v1_FlexVolumeSource(in FlexVolumeSource, out *FlexVolumeSource, c if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(LocalObjectReference) - if err := DeepCopy_v1_LocalObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretRef = nil } @@ -996,18 +918,14 @@ func DeepCopy_v1_GlusterfsVolumeSource(in GlusterfsVolumeSource, out *GlusterfsV func DeepCopy_v1_HTTPGetAction(in HTTPGetAction, out *HTTPGetAction, c *conversion.Cloner) error { out.Path = in.Path - if err := intstr.DeepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { - return err - } + out.Port = in.Port out.Host = in.Host out.Scheme = in.Scheme if in.HTTPHeaders != nil { in, out := in.HTTPHeaders, &out.HTTPHeaders *out = make([]HTTPHeader, len(in)) for i := range in { - if err := DeepCopy_v1_HTTPHeader(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.HTTPHeaders = nil @@ -1043,9 +961,7 @@ func DeepCopy_v1_Handler(in Handler, out *Handler, c *conversion.Cloner) error { if in.TCPSocket != nil { in, out := in.TCPSocket, &out.TCPSocket *out = new(TCPSocketAction) - if err := DeepCopy_v1_TCPSocketAction(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.TCPSocket = nil } @@ -1096,9 +1012,7 @@ func DeepCopy_v1_Lifecycle(in Lifecycle, out *Lifecycle, c *conversion.Cloner) e } func DeepCopy_v1_LimitRange(in LimitRange, out *LimitRange, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -1114,11 +1028,7 @@ func DeepCopy_v1_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conve in, out := in.Max, &out.Max *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Max = nil @@ -1127,11 +1037,7 @@ func DeepCopy_v1_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conve in, out := in.Min, &out.Min *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Min = nil @@ -1140,11 +1046,7 @@ func DeepCopy_v1_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conve in, out := in.Default, &out.Default *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Default = nil @@ -1153,11 +1055,7 @@ func DeepCopy_v1_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conve in, out := in.DefaultRequest, &out.DefaultRequest *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.DefaultRequest = nil @@ -1166,11 +1064,7 @@ func DeepCopy_v1_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conve in, out := in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.MaxLimitRequestRatio = nil @@ -1179,12 +1073,8 @@ func DeepCopy_v1_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conve } func DeepCopy_v1_LimitRangeList(in LimitRangeList, out *LimitRangeList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]LimitRange, len(in)) @@ -1215,12 +1105,8 @@ func DeepCopy_v1_LimitRangeSpec(in LimitRangeSpec, out *LimitRangeSpec, c *conve } func DeepCopy_v1_List(in List, out *List, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]runtime.RawExtension, len(in)) @@ -1236,9 +1122,7 @@ func DeepCopy_v1_List(in List, out *List, c *conversion.Cloner) error { } func DeepCopy_v1_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.LabelSelector = in.LabelSelector out.FieldSelector = in.FieldSelector out.Watch = in.Watch @@ -1264,9 +1148,7 @@ func DeepCopy_v1_LoadBalancerStatus(in LoadBalancerStatus, out *LoadBalancerStat in, out := in.Ingress, &out.Ingress *out = make([]LoadBalancerIngress, len(in)) for i := range in { - if err := DeepCopy_v1_LoadBalancerIngress(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ingress = nil @@ -1287,28 +1169,20 @@ func DeepCopy_v1_NFSVolumeSource(in NFSVolumeSource, out *NFSVolumeSource, c *co } func DeepCopy_v1_Namespace(in Namespace, out *Namespace, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1_NamespaceSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1_NamespaceStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_v1_NamespaceList(in NamespaceList, out *NamespaceList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Namespace, len(in)) @@ -1342,15 +1216,11 @@ func DeepCopy_v1_NamespaceStatus(in NamespaceStatus, out *NamespaceStatus, c *co } func DeepCopy_v1_Node(in Node, out *Node, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_v1_NodeSpec(in.Spec, &out.Spec, c); err != nil { - return err - } + out.Spec = in.Spec if err := DeepCopy_v1_NodeStatus(in.Status, &out.Status, c); err != nil { return err } @@ -1390,31 +1260,21 @@ func DeepCopy_v1_NodeAffinity(in NodeAffinity, out *NodeAffinity, c *conversion. func DeepCopy_v1_NodeCondition(in NodeCondition, out *NodeCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastHeartbeatTime, &out.LastHeartbeatTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastHeartbeatTime = in.LastHeartbeatTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_v1_NodeDaemonEndpoints(in NodeDaemonEndpoints, out *NodeDaemonEndpoints, c *conversion.Cloner) error { - if err := DeepCopy_v1_DaemonEndpoint(in.KubeletEndpoint, &out.KubeletEndpoint, c); err != nil { - return err - } + out.KubeletEndpoint = in.KubeletEndpoint return nil } func DeepCopy_v1_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Node, len(in)) @@ -1430,9 +1290,7 @@ func DeepCopy_v1_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) erro } func DeepCopy_v1_NodeProxyOptions(in NodeProxyOptions, out *NodeProxyOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Path = in.Path return nil } @@ -1493,11 +1351,7 @@ func DeepCopy_v1_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Cloner in, out := in.Capacity, &out.Capacity *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Capacity = nil @@ -1506,11 +1360,7 @@ func DeepCopy_v1_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Cloner in, out := in.Allocatable, &out.Allocatable *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Allocatable = nil @@ -1531,19 +1381,13 @@ func DeepCopy_v1_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Cloner in, out := in.Addresses, &out.Addresses *out = make([]NodeAddress, len(in)) for i := range in { - if err := DeepCopy_v1_NodeAddress(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Addresses = nil } - if err := DeepCopy_v1_NodeDaemonEndpoints(in.DaemonEndpoints, &out.DaemonEndpoints, c); err != nil { - return err - } - if err := DeepCopy_v1_NodeSystemInfo(in.NodeInfo, &out.NodeInfo, c); err != nil { - return err - } + out.DaemonEndpoints = in.DaemonEndpoints + out.NodeInfo = in.NodeInfo if in.Images != nil { in, out := in.Images, &out.Images *out = make([]ContainerImage, len(in)) @@ -1568,9 +1412,7 @@ func DeepCopy_v1_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Cloner in, out := in.VolumesAttached, &out.VolumesAttached *out = make([]AttachedVolume, len(in)) for i := range in { - if err := DeepCopy_v1_AttachedVolume(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.VolumesAttached = nil @@ -1606,15 +1448,11 @@ func DeepCopy_v1_ObjectMeta(in ObjectMeta, out *ObjectMeta, c *conversion.Cloner out.UID = in.UID out.ResourceVersion = in.ResourceVersion out.Generation = in.Generation - if err := unversioned.DeepCopy_unversioned_Time(in.CreationTimestamp, &out.CreationTimestamp, c); err != nil { - return err - } + out.CreationTimestamp = in.CreationTimestamp.DeepCopy() if in.DeletionTimestamp != nil { in, out := in.DeletionTimestamp, &out.DeletionTimestamp *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.DeletionTimestamp = nil } @@ -1691,25 +1529,19 @@ func DeepCopy_v1_OwnerReference(in OwnerReference, out *OwnerReference, c *conve } func DeepCopy_v1_PersistentVolume(in PersistentVolume, out *PersistentVolume, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1_PersistentVolumeSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1_PersistentVolumeStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_v1_PersistentVolumeClaim(in PersistentVolumeClaim, out *PersistentVolumeClaim, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -1723,12 +1555,8 @@ func DeepCopy_v1_PersistentVolumeClaim(in PersistentVolumeClaim, out *Persistent } func DeepCopy_v1_PersistentVolumeClaimList(in PersistentVolumeClaimList, out *PersistentVolumeClaimList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PersistentVolumeClaim, len(in)) @@ -1784,11 +1612,7 @@ func DeepCopy_v1_PersistentVolumeClaimStatus(in PersistentVolumeClaimStatus, out in, out := in.Capacity, &out.Capacity *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Capacity = nil @@ -1803,12 +1627,8 @@ func DeepCopy_v1_PersistentVolumeClaimVolumeSource(in PersistentVolumeClaimVolum } func DeepCopy_v1_PersistentVolumeList(in PersistentVolumeList, out *PersistentVolumeList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PersistentVolume, len(in)) @@ -1827,45 +1647,35 @@ func DeepCopy_v1_PersistentVolumeSource(in PersistentVolumeSource, out *Persiste if in.GCEPersistentDisk != nil { in, out := in.GCEPersistentDisk, &out.GCEPersistentDisk *out = new(GCEPersistentDiskVolumeSource) - if err := DeepCopy_v1_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.GCEPersistentDisk = nil } if in.AWSElasticBlockStore != nil { in, out := in.AWSElasticBlockStore, &out.AWSElasticBlockStore *out = new(AWSElasticBlockStoreVolumeSource) - if err := DeepCopy_v1_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AWSElasticBlockStore = nil } if in.HostPath != nil { in, out := in.HostPath, &out.HostPath *out = new(HostPathVolumeSource) - if err := DeepCopy_v1_HostPathVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.HostPath = nil } if in.Glusterfs != nil { in, out := in.Glusterfs, &out.Glusterfs *out = new(GlusterfsVolumeSource) - if err := DeepCopy_v1_GlusterfsVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Glusterfs = nil } if in.NFS != nil { in, out := in.NFS, &out.NFS *out = new(NFSVolumeSource) - if err := DeepCopy_v1_NFSVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NFS = nil } @@ -1881,18 +1691,14 @@ func DeepCopy_v1_PersistentVolumeSource(in PersistentVolumeSource, out *Persiste if in.ISCSI != nil { in, out := in.ISCSI, &out.ISCSI *out = new(ISCSIVolumeSource) - if err := DeepCopy_v1_ISCSIVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ISCSI = nil } if in.Cinder != nil { in, out := in.Cinder, &out.Cinder *out = new(CinderVolumeSource) - if err := DeepCopy_v1_CinderVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Cinder = nil } @@ -1917,9 +1723,7 @@ func DeepCopy_v1_PersistentVolumeSource(in PersistentVolumeSource, out *Persiste if in.Flocker != nil { in, out := in.Flocker, &out.Flocker *out = new(FlockerVolumeSource) - if err := DeepCopy_v1_FlockerVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Flocker = nil } @@ -1935,18 +1739,14 @@ func DeepCopy_v1_PersistentVolumeSource(in PersistentVolumeSource, out *Persiste if in.AzureFile != nil { in, out := in.AzureFile, &out.AzureFile *out = new(AzureFileVolumeSource) - if err := DeepCopy_v1_AzureFileVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AzureFile = nil } if in.VsphereVolume != nil { in, out := in.VsphereVolume, &out.VsphereVolume *out = new(VsphereVirtualDiskVolumeSource) - if err := DeepCopy_v1_VsphereVirtualDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.VsphereVolume = nil } @@ -1958,11 +1758,7 @@ func DeepCopy_v1_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentVo in, out := in.Capacity, &out.Capacity *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Capacity = nil @@ -1982,9 +1778,7 @@ func DeepCopy_v1_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentVo if in.ClaimRef != nil { in, out := in.ClaimRef, &out.ClaimRef *out = new(ObjectReference) - if err := DeepCopy_v1_ObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ClaimRef = nil } @@ -2000,9 +1794,7 @@ func DeepCopy_v1_PersistentVolumeStatus(in PersistentVolumeStatus, out *Persiste } func DeepCopy_v1_Pod(in Pod, out *Pod, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2089,9 +1881,7 @@ func DeepCopy_v1_PodAntiAffinity(in PodAntiAffinity, out *PodAntiAffinity, c *co } func DeepCopy_v1_PodAttachOptions(in PodAttachOptions, out *PodAttachOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Stdin = in.Stdin out.Stdout = in.Stdout out.Stderr = in.Stderr @@ -2103,21 +1893,15 @@ func DeepCopy_v1_PodAttachOptions(in PodAttachOptions, out *PodAttachOptions, c func DeepCopy_v1_PodCondition(in PodCondition, out *PodCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_v1_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Stdin = in.Stdin out.Stdout = in.Stdout out.Stderr = in.Stderr @@ -2134,12 +1918,8 @@ func DeepCopy_v1_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conve } func DeepCopy_v1_PodList(in PodList, out *PodList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Pod, len(in)) @@ -2155,9 +1935,7 @@ func DeepCopy_v1_PodList(in PodList, out *PodList, c *conversion.Cloner) error { } func DeepCopy_v1_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Container = in.Container out.Follow = in.Follow out.Previous = in.Previous @@ -2171,9 +1949,7 @@ func DeepCopy_v1_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *conversi if in.SinceTime != nil { in, out := in.SinceTime, &out.SinceTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.SinceTime = nil } @@ -2196,9 +1972,7 @@ func DeepCopy_v1_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *conversi } func DeepCopy_v1_PodProxyOptions(in PodProxyOptions, out *PodProxyOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Path = in.Path return nil } @@ -2207,9 +1981,7 @@ func DeepCopy_v1_PodSecurityContext(in PodSecurityContext, out *PodSecurityConte if in.SELinuxOptions != nil { in, out := in.SELinuxOptions, &out.SELinuxOptions *out = new(SELinuxOptions) - if err := DeepCopy_v1_SELinuxOptions(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SELinuxOptions = nil } @@ -2322,9 +2094,7 @@ func DeepCopy_v1_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error { in, out := in.ImagePullSecrets, &out.ImagePullSecrets *out = make([]LocalObjectReference, len(in)) for i := range in { - if err := DeepCopy_v1_LocalObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.ImagePullSecrets = nil @@ -2354,9 +2124,7 @@ func DeepCopy_v1_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) e if in.StartTime != nil { in, out := in.StartTime, &out.StartTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.StartTime = nil } @@ -2386,9 +2154,7 @@ func DeepCopy_v1_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) e } func DeepCopy_v1_PodStatusResult(in PodStatusResult, out *PodStatusResult, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2399,9 +2165,7 @@ func DeepCopy_v1_PodStatusResult(in PodStatusResult, out *PodStatusResult, c *co } func DeepCopy_v1_PodTemplate(in PodTemplate, out *PodTemplate, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2412,12 +2176,8 @@ func DeepCopy_v1_PodTemplate(in PodTemplate, out *PodTemplate, c *conversion.Clo } func DeepCopy_v1_PodTemplateList(in PodTemplateList, out *PodTemplateList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PodTemplate, len(in)) @@ -2489,9 +2249,7 @@ func DeepCopy_v1_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *co if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(LocalObjectReference) - if err := DeepCopy_v1_LocalObjectReference(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SecretRef = nil } @@ -2500,9 +2258,7 @@ func DeepCopy_v1_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *co } func DeepCopy_v1_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2518,28 +2274,20 @@ func DeepCopy_v1_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *co } func DeepCopy_v1_ReplicationController(in ReplicationController, out *ReplicationController, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1_ReplicationControllerSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1_ReplicationControllerStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_v1_ReplicationControllerList(in ReplicationControllerList, out *ReplicationControllerList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ReplicationController, len(in)) @@ -2593,16 +2341,12 @@ func DeepCopy_v1_ReplicationControllerStatus(in ReplicationControllerStatus, out func DeepCopy_v1_ResourceFieldSelector(in ResourceFieldSelector, out *ResourceFieldSelector, c *conversion.Cloner) error { out.ContainerName = in.ContainerName out.Resource = in.Resource - if err := resource.DeepCopy_resource_Quantity(in.Divisor, &out.Divisor, c); err != nil { - return err - } + out.Divisor = in.Divisor.DeepCopy() return nil } func DeepCopy_v1_ResourceQuota(in ResourceQuota, out *ResourceQuota, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2616,12 +2360,8 @@ func DeepCopy_v1_ResourceQuota(in ResourceQuota, out *ResourceQuota, c *conversi } func DeepCopy_v1_ResourceQuotaList(in ResourceQuotaList, out *ResourceQuotaList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ResourceQuota, len(in)) @@ -2641,11 +2381,7 @@ func DeepCopy_v1_ResourceQuotaSpec(in ResourceQuotaSpec, out *ResourceQuotaSpec, in, out := in.Hard, &out.Hard *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Hard = nil @@ -2667,11 +2403,7 @@ func DeepCopy_v1_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuotaS in, out := in.Hard, &out.Hard *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Hard = nil @@ -2680,11 +2412,7 @@ func DeepCopy_v1_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuotaS in, out := in.Used, &out.Used *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Used = nil @@ -2697,11 +2425,7 @@ func DeepCopy_v1_ResourceRequirements(in ResourceRequirements, out *ResourceRequ in, out := in.Limits, &out.Limits *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Limits = nil @@ -2710,11 +2434,7 @@ func DeepCopy_v1_ResourceRequirements(in ResourceRequirements, out *ResourceRequ in, out := in.Requests, &out.Requests *out = make(ResourceList) for key, val := range in { - newVal := new(resource.Quantity) - if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal + (*out)[key] = val.DeepCopy() } } else { out.Requests = nil @@ -2731,9 +2451,7 @@ func DeepCopy_v1_SELinuxOptions(in SELinuxOptions, out *SELinuxOptions, c *conve } func DeepCopy_v1_Secret(in Secret, out *Secret, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2750,25 +2468,28 @@ func DeepCopy_v1_Secret(in Secret, out *Secret, c *conversion.Cloner) error { } else { out.Data = nil } + if in.StringData != nil { + in, out := in.StringData, &out.StringData + *out = make(map[string]string) + for key, val := range in { + (*out)[key] = val + } + } else { + out.StringData = nil + } out.Type = in.Type return nil } func DeepCopy_v1_SecretKeySelector(in SecretKeySelector, out *SecretKeySelector, c *conversion.Cloner) error { - if err := DeepCopy_v1_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { - return err - } + out.LocalObjectReference = in.LocalObjectReference out.Key = in.Key return nil } func DeepCopy_v1_SecretList(in SecretList, out *SecretList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Secret, len(in)) @@ -2789,9 +2510,7 @@ func DeepCopy_v1_SecretVolumeSource(in SecretVolumeSource, out *SecretVolumeSour in, out := in.Items, &out.Items *out = make([]KeyToPath, len(in)) for i := range in { - if err := DeepCopy_v1_KeyToPath(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Items = nil @@ -2819,9 +2538,7 @@ func DeepCopy_v1_SecurityContext(in SecurityContext, out *SecurityContext, c *co if in.SELinuxOptions != nil { in, out := in.SELinuxOptions, &out.SELinuxOptions *out = new(SELinuxOptions) - if err := DeepCopy_v1_SELinuxOptions(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SELinuxOptions = nil } @@ -2850,19 +2567,13 @@ func DeepCopy_v1_SecurityContext(in SecurityContext, out *SecurityContext, c *co } func DeepCopy_v1_SerializedReference(in SerializedReference, out *SerializedReference, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_ObjectReference(in.Reference, &out.Reference, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.Reference = in.Reference return nil } func DeepCopy_v1_Service(in Service, out *Service, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2876,9 +2587,7 @@ func DeepCopy_v1_Service(in Service, out *Service, c *conversion.Cloner) error { } func DeepCopy_v1_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -2886,9 +2595,7 @@ func DeepCopy_v1_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conve in, out := in.Secrets, &out.Secrets *out = make([]ObjectReference, len(in)) for i := range in { - if err := DeepCopy_v1_ObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Secrets = nil @@ -2897,9 +2604,7 @@ func DeepCopy_v1_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conve in, out := in.ImagePullSecrets, &out.ImagePullSecrets *out = make([]LocalObjectReference, len(in)) for i := range in { - if err := DeepCopy_v1_LocalObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.ImagePullSecrets = nil @@ -2908,12 +2613,8 @@ func DeepCopy_v1_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conve } func DeepCopy_v1_ServiceAccountList(in ServiceAccountList, out *ServiceAccountList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ServiceAccount, len(in)) @@ -2929,12 +2630,8 @@ func DeepCopy_v1_ServiceAccountList(in ServiceAccountList, out *ServiceAccountLi } func DeepCopy_v1_ServiceList(in ServiceList, out *ServiceList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Service, len(in)) @@ -2953,17 +2650,13 @@ func DeepCopy_v1_ServicePort(in ServicePort, out *ServicePort, c *conversion.Clo out.Name = in.Name out.Protocol = in.Protocol out.Port = in.Port - if err := intstr.DeepCopy_intstr_IntOrString(in.TargetPort, &out.TargetPort, c); err != nil { - return err - } + out.TargetPort = in.TargetPort out.NodePort = in.NodePort return nil } func DeepCopy_v1_ServiceProxyOptions(in ServiceProxyOptions, out *ServiceProxyOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Path = in.Path return nil } @@ -2973,9 +2666,7 @@ func DeepCopy_v1_ServiceSpec(in ServiceSpec, out *ServiceSpec, c *conversion.Clo in, out := in.Ports, &out.Ports *out = make([]ServicePort, len(in)) for i := range in { - if err := DeepCopy_v1_ServicePort(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ports = nil @@ -3025,9 +2716,7 @@ func DeepCopy_v1_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *conversi } func DeepCopy_v1_TCPSocketAction(in TCPSocketAction, out *TCPSocketAction, c *conversion.Cloner) error { - if err := intstr.DeepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { - return err - } + out.Port = in.Port return nil } @@ -3066,45 +2755,35 @@ func DeepCopy_v1_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion. if in.HostPath != nil { in, out := in.HostPath, &out.HostPath *out = new(HostPathVolumeSource) - if err := DeepCopy_v1_HostPathVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.HostPath = nil } if in.EmptyDir != nil { in, out := in.EmptyDir, &out.EmptyDir *out = new(EmptyDirVolumeSource) - if err := DeepCopy_v1_EmptyDirVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.EmptyDir = nil } if in.GCEPersistentDisk != nil { in, out := in.GCEPersistentDisk, &out.GCEPersistentDisk *out = new(GCEPersistentDiskVolumeSource) - if err := DeepCopy_v1_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.GCEPersistentDisk = nil } if in.AWSElasticBlockStore != nil { in, out := in.AWSElasticBlockStore, &out.AWSElasticBlockStore *out = new(AWSElasticBlockStoreVolumeSource) - if err := DeepCopy_v1_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AWSElasticBlockStore = nil } if in.GitRepo != nil { in, out := in.GitRepo, &out.GitRepo *out = new(GitRepoVolumeSource) - if err := DeepCopy_v1_GitRepoVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.GitRepo = nil } @@ -3120,36 +2799,28 @@ func DeepCopy_v1_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion. if in.NFS != nil { in, out := in.NFS, &out.NFS *out = new(NFSVolumeSource) - if err := DeepCopy_v1_NFSVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NFS = nil } if in.ISCSI != nil { in, out := in.ISCSI, &out.ISCSI *out = new(ISCSIVolumeSource) - if err := DeepCopy_v1_ISCSIVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ISCSI = nil } if in.Glusterfs != nil { in, out := in.Glusterfs, &out.Glusterfs *out = new(GlusterfsVolumeSource) - if err := DeepCopy_v1_GlusterfsVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Glusterfs = nil } if in.PersistentVolumeClaim != nil { in, out := in.PersistentVolumeClaim, &out.PersistentVolumeClaim *out = new(PersistentVolumeClaimVolumeSource) - if err := DeepCopy_v1_PersistentVolumeClaimVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.PersistentVolumeClaim = nil } @@ -3174,9 +2845,7 @@ func DeepCopy_v1_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion. if in.Cinder != nil { in, out := in.Cinder, &out.Cinder *out = new(CinderVolumeSource) - if err := DeepCopy_v1_CinderVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Cinder = nil } @@ -3192,9 +2861,7 @@ func DeepCopy_v1_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion. if in.Flocker != nil { in, out := in.Flocker, &out.Flocker *out = new(FlockerVolumeSource) - if err := DeepCopy_v1_FlockerVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Flocker = nil } @@ -3219,9 +2886,7 @@ func DeepCopy_v1_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion. if in.AzureFile != nil { in, out := in.AzureFile, &out.AzureFile *out = new(AzureFileVolumeSource) - if err := DeepCopy_v1_AzureFileVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.AzureFile = nil } @@ -3237,9 +2902,7 @@ func DeepCopy_v1_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion. if in.VsphereVolume != nil { in, out := in.VsphereVolume, &out.VsphereVolume *out = new(VsphereVirtualDiskVolumeSource) - if err := DeepCopy_v1_VsphereVirtualDiskVolumeSource(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.VsphereVolume = nil } diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/defaults.go b/vendor/k8s.io/kubernetes/pkg/api/v1/defaults.go index c6f11b4ee..5d6323fb4 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/doc.go b/vendor/k8s.io/kubernetes/pkg/api/v1/doc.go index bf85d77a1..8849ee1cb 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/api + // Package v1 is the v1 version of the API. -// +genconversion=true package v1 diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/api/v1/generated.pb.go index 78477e4bf..16ac125d5 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6713,6 +6713,23 @@ func (m *Secret) MarshalTo(data []byte) (int, error) { i++ i = encodeVarintGenerated(data, i, uint64(len(m.Type))) i += copy(data[i:], m.Type) + if len(m.StringData) > 0 { + for k := range m.StringData { + data[i] = 0x22 + i++ + v := m.StringData[k] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(data, i, uint64(mapSize)) + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(len(k))) + i += copy(data[i:], k) + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(len(v))) + i += copy(data[i:], v) + } + } return i, nil } @@ -9870,6 +9887,14 @@ func (m *Secret) Size() (n int) { } l = len(m.Type) n += 1 + l + sovGenerated(uint64(l)) + if len(m.StringData) > 0 { + for k, v := range m.StringData { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } return n } @@ -31125,6 +31150,117 @@ func (m *Secret) Unmarshal(data []byte) error { } m.Type = SecretType(data[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StringData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(data[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue := string(data[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + if m.StringData == nil { + m.StringData = make(map[string]string) + } + m.StringData[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(data[iNdEx:]) diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/generated.proto b/vendor/k8s.io/kubernetes/pkg/api/v1/generated.proto index 249b9ddba..060b6cac4 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -117,27 +117,27 @@ message Capabilities { // Cephfs volumes do not support ownership management or SELinux relabeling. message CephFSVolumeSource { // Required: Monitors is a collection of Ceph monitors - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it repeated string monitors = 1; // Optional: Used as the mounted root, rather than the full Ceph tree, default is / optional string path = 2; // Optional: User is the rados user name, default is admin - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it optional string user = 3; // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it optional string secretFile = 4; // Optional: SecretRef is reference to the authentication secret for User, default is empty. - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it optional LocalObjectReference secretRef = 5; // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it optional bool readOnly = 6; } @@ -844,16 +844,16 @@ message GitRepoVolumeSource { // Glusterfs volumes do not support ownership management or SELinux relabeling. message GlusterfsVolumeSource { // EndpointsName is the endpoint name that details Glusterfs topology. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod optional string endpoints = 1; // Path is the Glusterfs volume path. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod optional string path = 2; // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. // Defaults to false. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod optional bool readOnly = 3; } @@ -1672,7 +1672,7 @@ message PersistentVolumeSource { // Glusterfs represents a Glusterfs volume that is attached to a host and // exposed to the pod. Provisioned by an admin. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md optional GlusterfsVolumeSource glusterfs = 4; // NFS represents an NFS mount on the host. Provisioned by an admin. @@ -1680,7 +1680,7 @@ message PersistentVolumeSource { optional NFSVolumeSource nfs = 5; // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md optional RBDVolumeSource rbd = 6; // ISCSI represents an ISCSI Disk resource that is attached to a @@ -2089,6 +2089,7 @@ message PodSpec { // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. // Deprecated: Use serviceAccountName instead. + // +k8s:conversion-gen=false optional string serviceAccount = 9; // NodeName is a request to schedule this pod onto a specific node. If it is non-empty, @@ -2099,14 +2100,17 @@ message PodSpec { // Host networking requested for this pod. Use the host's network namespace. // If this option is set, the ports that will be used must be specified. // Default to false. + // +k8s:conversion-gen=false optional bool hostNetwork = 11; // Use the host's pid namespace. // Optional: Default to false. + // +k8s:conversion-gen=false optional bool hostPID = 12; // Use the host's ipc namespace. // Optional: Default to false. + // +k8s:conversion-gen=false optional bool hostIPC = 13; // SecurityContext holds pod-level security attributes and common container settings. @@ -2257,11 +2261,11 @@ message Probe { // RBD volumes support ownership management and SELinux relabeling. message RBDVolumeSource { // A collection of Ceph monitors. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it repeated string monitors = 1; // The rados image name. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it optional string image = 2; // Filesystem type of the volume that you want to mount. @@ -2273,28 +2277,28 @@ message RBDVolumeSource { // The rados pool name. // Default is rbd. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it. + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it. optional string pool = 4; // The rados user name. // Default is admin. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it optional string user = 5; // Keyring is the path to key ring for RBDUser. // Default is /etc/ceph/keyring. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it optional string keyring = 6; // SecretRef is name of the authentication secret for RBDUser. If provided // overrides keyring. // Default is nil. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it optional LocalObjectReference secretRef = 7; // ReadOnly here will force the ReadOnly setting in VolumeMounts. // Defaults to false. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it optional bool readOnly = 8; } @@ -2477,6 +2481,13 @@ message Secret { // Described in https://tools.ietf.org/html/rfc4648#section-4 map data = 2; + // stringData allows specifying non-binary secret data in string form. + // It is provided as a write-only convenience method. + // All keys and values are merged into the data field on write, overwriting any existing values. + // It is never output when reading from the API. + // +k8s:conversion-gen=false + map stringData = 4; + // Used to facilitate programmatic handling of secret data. optional string type = 3; } @@ -2676,7 +2687,7 @@ message ServiceSpec { // This service will route traffic to pods having labels matching this selector. // Label keys and values that must match in order to receive traffic for this service. - // If empty, all pods are selected, if not specified, endpoints must be manually specified. + // If not specified, endpoints must be manually specified and the system will not automatically manage them. // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview map selector = 2; @@ -2708,7 +2719,7 @@ message ServiceSpec { // API for compatibility until at least 8/20/2016. It will be removed from // any new API revisions. If both deprecatedPublicIPs *and* externalIPs are // set, deprecatedPublicIPs is used. - // +genconversion=false + // +k8s:conversion-gen=false repeated string deprecatedPublicIPs = 6; // Supports "ClientIP" and "None". Used to maintain session affinity. @@ -2854,11 +2865,11 @@ message VolumeSource { // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - // More info: http://releases.k8s.io/HEAD/examples/iscsi/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md optional ISCSIVolumeSource iscsi = 8; // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md optional GlusterfsVolumeSource glusterfs = 9; // PersistentVolumeClaimVolumeSource represents a reference to a @@ -2867,7 +2878,7 @@ message VolumeSource { optional PersistentVolumeClaimVolumeSource persistentVolumeClaim = 10; // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md optional RBDVolumeSource rbd = 11; // FlexVolume represents a generic volume resource that is diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/meta.go b/vendor/k8s.io/kubernetes/pkg/api/v1/meta.go index 935bd973b..d5ba042a2 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/meta.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/meta.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/register.go b/vendor/k8s.io/kubernetes/pkg/api/v1/register.go index bf07189ee..8c625b878 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/api/v1/types.generated.go index 1b6c236db..93c45dadf 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49484,17 +49484,18 @@ func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool + var yyq2 [6]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false yyq2[0] = true yyq2[1] = len(x.Data) != 0 - yyq2[2] = x.Type != "" - yyq2[3] = x.Kind != "" - yyq2[4] = x.APIVersion != "" + yyq2[2] = len(x.StringData) != 0 + yyq2[3] = x.Type != "" + yyq2[4] = x.Kind != "" + yyq2[5] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) + r.EncodeArrayStart(6) } else { yynn2 = 0 for _, b := range yyq2 { @@ -49558,41 +49559,49 @@ func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq2[2] { - x.Type.CodecEncodeSelf(e) + if x.StringData == nil { + r.EncodeNil() + } else { + yym12 := z.EncBinary() + _ = yym12 + if false { + } else { + z.F.EncMapStringStringV(x.StringData, false, e) + } + } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq2[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("type")) + r.EncodeString(codecSelferC_UTF81234, string("stringData")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Type.CodecEncodeSelf(e) + if x.StringData == nil { + r.EncodeNil() + } else { + yym13 := z.EncBinary() + _ = yym13 + if false { + } else { + z.F.EncMapStringStringV(x.StringData, false, e) + } + } } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq2[3] { - yym15 := z.EncBinary() - _ = yym15 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq2[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + x.Type.CodecEncodeSelf(e) } } if yyr2 || yy2arr2 { @@ -49602,7 +49611,7 @@ func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym18 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -49610,11 +49619,36 @@ func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq2[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym19 := z.EncBinary() _ = yym19 if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[5] { + yym21 := z.EncBinary() + _ = yym21 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym22 := z.EncBinary() + _ = yym22 + if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } @@ -49700,6 +49734,18 @@ func (x *Secret) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { h.decMapstringSliceuint8((*map[string][]uint8)(yyv5), d) } } + case "stringData": + if r.TryDecodeAsNil() { + x.StringData = nil + } else { + yyv7 := &x.StringData + yym8 := z.DecBinary() + _ = yym8 + if false { + } else { + z.F.DecMapStringStringX(yyv7, false, d) + } + } case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -49729,16 +49775,16 @@ func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + var yyj12 int + var yyb12 bool + var yyhl12 bool = l >= 0 + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - yyb10 = r.CheckBreak() + yyb12 = r.CheckBreak() } - if yyb10 { + if yyb12 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -49746,16 +49792,16 @@ func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv11 := &x.ObjectMeta - yyv11.CodecDecodeSelf(d) + yyv13 := &x.ObjectMeta + yyv13.CodecDecodeSelf(d) } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - yyb10 = r.CheckBreak() + yyb12 = r.CheckBreak() } - if yyb10 { + if yyb12 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -49763,21 +49809,43 @@ func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Data = nil } else { - yyv12 := &x.Data - yym13 := z.DecBinary() - _ = yym13 + yyv14 := &x.Data + yym15 := z.DecBinary() + _ = yym15 if false { } else { - h.decMapstringSliceuint8((*map[string][]uint8)(yyv12), d) + h.decMapstringSliceuint8((*map[string][]uint8)(yyv14), d) } } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - yyb10 = r.CheckBreak() + yyb12 = r.CheckBreak() } - if yyb10 { + if yyb12 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.StringData = nil + } else { + yyv16 := &x.StringData + yym17 := z.DecBinary() + _ = yym17 + if false { + } else { + z.F.DecMapStringStringX(yyv16, false, d) + } + } + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l + } else { + yyb12 = r.CheckBreak() + } + if yyb12 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -49787,13 +49855,13 @@ func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = SecretType(r.DecodeString()) } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - yyb10 = r.CheckBreak() + yyb12 = r.CheckBreak() } - if yyb10 { + if yyb12 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -49803,13 +49871,13 @@ func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - yyb10 = r.CheckBreak() + yyb12 = r.CheckBreak() } - if yyb10 { + if yyb12 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -49820,17 +49888,17 @@ func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.APIVersion = string(r.DecodeString()) } for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - yyb10 = r.CheckBreak() + yyb12 = r.CheckBreak() } - if yyb10 { + if yyb12 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj10-1, "") + z.DecStructFieldNotFound(yyj12-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -59376,7 +59444,7 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { yyrg1 := len(yyv1) > 0 yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 264) + yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 272) if yyrt1 { if yyrl1 <= cap(yyv1) { yyv1 = yyv1[:yyrl1] diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/types.go b/vendor/k8s.io/kubernetes/pkg/api/v1/types.go index 5079c36f7..42a0b9879 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -241,17 +241,17 @@ type VolumeSource struct { NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,7,opt,name=nfs"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - // More info: http://releases.k8s.io/HEAD/examples/iscsi/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" protobuf:"bytes,8,opt,name=iscsi"` // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,9,opt,name=glusterfs"` // PersistentVolumeClaimVolumeSource represents a reference to a // PersistentVolumeClaim in the same namespace. // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" protobuf:"bytes,10,opt,name=persistentVolumeClaim"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md RBD *RBDVolumeSource `json:"rbd,omitempty" protobuf:"bytes,11,opt,name=rbd"` // FlexVolume represents a generic volume resource that is // provisioned/attached using a exec based plugin. This is an @@ -311,13 +311,13 @@ type PersistentVolumeSource struct { HostPath *HostPathVolumeSource `json:"hostPath,omitempty" protobuf:"bytes,3,opt,name=hostPath"` // Glusterfs represents a Glusterfs volume that is attached to a host and // exposed to the pod. Provisioned by an admin. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,4,opt,name=glusterfs"` // NFS represents an NFS mount on the host. Provisioned by an admin. // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,5,opt,name=nfs"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md RBD *RBDVolumeSource `json:"rbd,omitempty" protobuf:"bytes,6,opt,name=rbd"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. Provisioned by an admin. @@ -341,7 +341,8 @@ type PersistentVolumeSource struct { VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,14,opt,name=vsphereVolume"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // PersistentVolume (PV) is a storage resource provisioned by an administrator. // It is analogous to a node. @@ -542,16 +543,16 @@ type EmptyDirVolumeSource struct { // Glusterfs volumes do not support ownership management or SELinux relabeling. type GlusterfsVolumeSource struct { // EndpointsName is the endpoint name that details Glusterfs topology. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod EndpointsName string `json:"endpoints" protobuf:"bytes,1,opt,name=endpoints"` // Path is the Glusterfs volume path. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod Path string `json:"path" protobuf:"bytes,2,opt,name=path"` // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. // Defaults to false. - // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod + // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` } @@ -559,10 +560,10 @@ type GlusterfsVolumeSource struct { // RBD volumes support ownership management and SELinux relabeling. type RBDVolumeSource struct { // A collection of Ceph monitors. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it CephMonitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` // The rados image name. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it RBDImage string `json:"image" protobuf:"bytes,2,opt,name=image"` // Filesystem type of the volume that you want to mount. // Tip: Ensure that the filesystem type is supported by the host operating system. @@ -572,24 +573,24 @@ type RBDVolumeSource struct { FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` // The rados pool name. // Default is rbd. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it. + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it. RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"` // The rados user name. // Default is admin. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"` // Keyring is the path to key ring for RBDUser. // Default is /etc/ceph/keyring. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"` // SecretRef is name of the authentication secret for RBDUser. If provided // overrides keyring. // Default is nil. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,7,opt,name=secretRef"` // ReadOnly here will force the ReadOnly setting in VolumeMounts. // Defaults to false. - // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,8,opt,name=readOnly"` } @@ -616,22 +617,22 @@ type CinderVolumeSource struct { // Cephfs volumes do not support ownership management or SELinux relabeling. type CephFSVolumeSource struct { // Required: Monitors is a collection of Ceph monitors - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it Monitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` // Optional: Used as the mounted root, rather than the full Ceph tree, default is / Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"` // Optional: User is the rados user name, default is admin - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it SecretFile string `json:"secretFile,omitempty" protobuf:"bytes,4,opt,name=secretFile"` // Optional: SecretRef is reference to the authentication secret for User, default is empty. - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. - // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it + // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` } @@ -1718,6 +1719,7 @@ type PodSpec struct { ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,8,opt,name=serviceAccountName"` // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. // Deprecated: Use serviceAccountName instead. + // +k8s:conversion-gen=false DeprecatedServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,9,opt,name=serviceAccount"` // NodeName is a request to schedule this pod onto a specific node. If it is non-empty, @@ -1727,12 +1729,15 @@ type PodSpec struct { // Host networking requested for this pod. Use the host's network namespace. // If this option is set, the ports that will be used must be specified. // Default to false. + // +k8s:conversion-gen=false HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,11,opt,name=hostNetwork"` // Use the host's pid namespace. // Optional: Default to false. + // +k8s:conversion-gen=false HostPID bool `json:"hostPID,omitempty" protobuf:"varint,12,opt,name=hostPID"` // Use the host's ipc namespace. // Optional: Default to false. + // +k8s:conversion-gen=false HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,13,opt,name=hostIPC"` // SecurityContext holds pod-level security attributes and common container settings. // Optional: Defaults to empty. See type description for default values of each field. @@ -2048,7 +2053,7 @@ type ServiceSpec struct { // This service will route traffic to pods having labels matching this selector. // Label keys and values that must match in order to receive traffic for this service. - // If empty, all pods are selected, if not specified, endpoints must be manually specified. + // If not specified, endpoints must be manually specified and the system will not automatically manage them. // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` @@ -2080,7 +2085,7 @@ type ServiceSpec struct { // API for compatibility until at least 8/20/2016. It will be removed from // any new API revisions. If both deprecatedPublicIPs *and* externalIPs are // set, deprecatedPublicIPs is used. - // +genconversion=false + // +k8s:conversion-gen=false DeprecatedPublicIPs []string `json:"deprecatedPublicIPs,omitempty" protobuf:"bytes,6,rep,name=deprecatedPublicIPs"` // Supports "ClientIP" and "None". Used to maintain session affinity. @@ -2497,7 +2502,8 @@ const ( // ResourceList is a set of (resource name, quantity) pairs. type ResourceList map[ResourceName]resource.Quantity -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // Node is a worker node in Kubernetes, formerly known as minion. // Each node will have a unique identifier in the cache (i.e. in etcd). @@ -2560,7 +2566,8 @@ const ( NamespaceTerminating NamespacePhase = "Terminating" ) -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // Namespace provides a scope for Names. // Use of multiple namespaces is optional. @@ -3089,6 +3096,13 @@ type Secret struct { // Described in https://tools.ietf.org/html/rfc4648#section-4 Data map[string][]byte `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` + // stringData allows specifying non-binary secret data in string form. + // It is provided as a write-only convenience method. + // All keys and values are merged into the data field on write, overwriting any existing values. + // It is never output when reading from the API. + // +k8s:conversion-gen=false + StringData map[string]string `json:"stringData,omitempty" protobuf:"bytes,4,rep,name=stringData"` + // Used to facilitate programmatic handling of secret data. Type SecretType `json:"type,omitempty" protobuf:"bytes,3,opt,name=type,casttype=SecretType"` } @@ -3208,7 +3222,8 @@ type ComponentCondition struct { Error string `json:"error,omitempty" protobuf:"bytes,4,opt,name=error"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // ComponentStatus (and ComponentStatusList) holds the cluster validation info. type ComponentStatus struct { diff --git a/vendor/k8s.io/kubernetes/pkg/api/v1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/api/v1/types_swagger_doc_generated.go index 26b45ccaf..c5eb00db3 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/api/v1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -93,12 +93,12 @@ func (Capabilities) SwaggerDoc() map[string]string { var map_CephFSVolumeSource = map[string]string{ "": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", - "monitors": "Required: Monitors is a collection of Ceph monitors More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it", + "monitors": "Required: Monitors is a collection of Ceph monitors More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", "path": "Optional: Used as the mounted root, rather than the full Ceph tree, default is /", - "user": "Optional: User is the rados user name, default is admin More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it", - "secretFile": "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it", - "secretRef": "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it", - "readOnly": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it", + "user": "Optional: User is the rados user name, default is admin More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", + "secretFile": "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", + "secretRef": "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", + "readOnly": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", } func (CephFSVolumeSource) SwaggerDoc() map[string]string { @@ -536,9 +536,9 @@ func (GitRepoVolumeSource) SwaggerDoc() map[string]string { var map_GlusterfsVolumeSource = map[string]string{ "": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", - "endpoints": "EndpointsName is the endpoint name that details Glusterfs topology. More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod", - "path": "Path is the Glusterfs volume path. More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod", - "readOnly": "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod", + "endpoints": "EndpointsName is the endpoint name that details Glusterfs topology. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", + "path": "Path is the Glusterfs volume path. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", + "readOnly": "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", } func (GlusterfsVolumeSource) SwaggerDoc() map[string]string { @@ -1056,9 +1056,9 @@ var map_PersistentVolumeSource = map[string]string{ "gcePersistentDisk": "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk", "awsElasticBlockStore": "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore", "hostPath": "HostPath represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#hostpath", - "glusterfs": "Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md", + "glusterfs": "Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", "nfs": "NFS represents an NFS mount on the host. Provisioned by an admin. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs", - "rbd": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md", + "rbd": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", "iscsi": "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin.", "cinder": "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", "cephfs": "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", @@ -1342,14 +1342,14 @@ func (Probe) SwaggerDoc() map[string]string { var map_RBDVolumeSource = map[string]string{ "": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", - "monitors": "A collection of Ceph monitors. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it", - "image": "The rados image name. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it", + "monitors": "A collection of Ceph monitors. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", + "image": "The rados image name. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", "fsType": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd", - "pool": "The rados pool name. Default is rbd. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it.", - "user": "The rados user name. Default is admin. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it", - "keyring": "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it", - "secretRef": "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it", - "readOnly": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it", + "pool": "The rados pool name. Default is rbd. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it.", + "user": "The rados user name. Default is admin. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", + "keyring": "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", + "secretRef": "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", + "readOnly": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", } func (RBDVolumeSource) SwaggerDoc() map[string]string { @@ -1485,10 +1485,11 @@ func (SELinuxOptions) SwaggerDoc() map[string]string { } var map_Secret = map[string]string{ - "": "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", - "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", - "data": "Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", - "type": "Used to facilitate programmatic handling of secret data.", + "": "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", + "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "data": "Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", + "stringData": "stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.", + "type": "Used to facilitate programmatic handling of secret data.", } func (Secret) SwaggerDoc() map[string]string { @@ -1614,7 +1615,7 @@ func (ServiceProxyOptions) SwaggerDoc() map[string]string { var map_ServiceSpec = map[string]string{ "": "ServiceSpec describes the attributes that a user creates on a service.", "ports": "The list of ports that are exposed by this service. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies", - "selector": "This service will route traffic to pods having labels matching this selector. Label keys and values that must match in order to receive traffic for this service. If empty, all pods are selected, if not specified, endpoints must be manually specified. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview", + "selector": "This service will route traffic to pods having labels matching this selector. Label keys and values that must match in order to receive traffic for this service. If not specified, endpoints must be manually specified and the system will not automatically manage them. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview", "clusterIP": "ClusterIP is usually assigned by the master and is the IP address of the service. If specified, it will be allocated to the service if it is unused or else creation of the service will fail. Valid values are None, empty string (\"\"), or a valid IP address. 'None' can be specified for a headless service when proxying is not required. Cannot be updated. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies", "type": "Type of exposed service. Must be ClusterIP, NodePort, or LoadBalancer. Defaults to ClusterIP. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#external-services", "externalIPs": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. A previous form of this functionality exists as the deprecatedPublicIPs field. When using this field, callers should also clear the deprecatedPublicIPs field.", @@ -1699,10 +1700,10 @@ var map_VolumeSource = map[string]string{ "gitRepo": "GitRepo represents a git repository at a particular revision.", "secret": "Secret represents a secret that should populate this volume. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#secrets", "nfs": "NFS represents an NFS mount on the host that shares a pod's lifetime More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs", - "iscsi": "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: http://releases.k8s.io/HEAD/examples/iscsi/README.md", - "glusterfs": "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md", + "iscsi": "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: http://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md", + "glusterfs": "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", "persistentVolumeClaim": "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims", - "rbd": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/rbd/README.md", + "rbd": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", "flexVolume": "FlexVolume represents a generic volume resource that is provisioned/attached using a exec based plugin. This is an alpha feature and may change in future.", "cinder": "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", "cephfs": "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", diff --git a/vendor/k8s.io/kubernetes/pkg/api/validation/doc.go b/vendor/k8s.io/kubernetes/pkg/api/validation/doc.go index 1b7051073..f17a15cf9 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/validation/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/api/validation/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/validation/events.go b/vendor/k8s.io/kubernetes/pkg/api/validation/events.go index 0a5de5443..754cf8830 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/validation/events.go +++ b/vendor/k8s.io/kubernetes/pkg/api/validation/events.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/validation/name.go b/vendor/k8s.io/kubernetes/pkg/api/validation/name.go index cf2eb8bb2..1358e6e7e 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/validation/name.go +++ b/vendor/k8s.io/kubernetes/pkg/api/validation/name.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/api/validation/schema.go b/vendor/k8s.io/kubernetes/pkg/api/validation/schema.go index 9c7078826..f6a4d0798 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/validation/schema.go +++ b/vendor/k8s.io/kubernetes/pkg/api/validation/schema.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -294,9 +294,13 @@ func (s *SwaggerSchema) isGenericArray(p swagger.ModelProperty) bool { } // This matches type name in the swagger spec, such as "v1.Binding". -var versionRegexp = regexp.MustCompile(`^v.+\..*`) +var versionRegexp = regexp.MustCompile(`^(v.+|unversioned)\..*`) func (s *SwaggerSchema) validateField(value interface{}, fieldName, fieldType string, fieldDetails *swagger.ModelProperty) []error { + allErrs := []error{} + if reflect.TypeOf(value) == nil { + return append(allErrs, fmt.Errorf("unexpected nil value for field %v", fieldName)) + } // TODO: caesarxuchao: because we have multiple group/versions and objects // may reference objects in other group, the commented out way of checking // if a filedType is a type defined by us is outdated. We use a hacky way @@ -310,7 +314,6 @@ func (s *SwaggerSchema) validateField(value interface{}, fieldName, fieldType st // if strings.HasPrefix(fieldType, apiVersion) { return s.ValidateObject(value, fieldName, fieldType) } - allErrs := []error{} switch fieldType { case "string": // Be loose about what we accept for 'string' since we use IntOrString in a couple of places diff --git a/vendor/k8s.io/kubernetes/pkg/api/validation/validation.go b/vendor/k8s.io/kubernetes/pkg/api/validation/validation.go index 5a12e79bf..3854004d8 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/validation/validation.go +++ b/vendor/k8s.io/kubernetes/pkg/api/validation/validation.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -19,12 +19,10 @@ package validation import ( "encoding/json" "fmt" - "math" "net" "os" "path" "reflect" - "regexp" "strings" "github.com/golang/glog" @@ -51,17 +49,9 @@ var RepairMalformedUpdates bool = true const isNegativeErrorMsg string = `must be greater than or equal to 0` const isInvalidQuotaResource string = `must be a standard resource for quota` const fieldImmutableErrorMsg string = `field is immutable` -const cIdentifierErrorMsg string = `must be a C identifier (matching regex ` + validation.CIdentifierFmt + `): e.g. "my_name" or "MyName"` const isNotIntegerErrorMsg string = `must be an integer` -func InclusiveRangeErrorMsg(lo, hi int) string { - return fmt.Sprintf(`must be between %d and %d, inclusive`, lo, hi) -} - -var pdPartitionErrorMsg string = InclusiveRangeErrorMsg(1, 255) -var PortRangeErrorMsg string = InclusiveRangeErrorMsg(1, 65535) -var IdRangeErrorMsg string = InclusiveRangeErrorMsg(0, math.MaxInt32) -var PortNameErrorMsg string = fmt.Sprintf(`must be an IANA_SVC_NAME (at most 15 characters, matching regex %s, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http"`, validation.IdentifierNoHyphensBeginEndFmt) +var pdPartitionErrorMsg string = validation.InclusiveRangeError(1, 255) const totalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB @@ -75,11 +65,13 @@ func ValidateHasLabel(meta api.ObjectMeta, fldPath *field.Path, key, expectedVal allErrs := field.ErrorList{} actualValue, found := meta.Labels[key] if !found { - allErrs = append(allErrs, field.Required(fldPath.Child("labels"), key+"="+expectedValue)) + allErrs = append(allErrs, field.Required(fldPath.Child("labels").Key(key), + fmt.Sprintf("must be '%s'", expectedValue))) return allErrs } if actualValue != expectedValue { - allErrs = append(allErrs, field.Invalid(fldPath.Child("labels"), meta.Labels, "expected "+key+"="+expectedValue)) + allErrs = append(allErrs, field.Invalid(fldPath.Child("labels").Key(key), meta.Labels, + fmt.Sprintf("must be '%s'", expectedValue))) } return allErrs } @@ -100,6 +92,14 @@ func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) fie return allErrs } +func ValidateDNS1123Label(value string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for _, msg := range validation.IsDNS1123Label(value) { + allErrs = append(allErrs, field.Invalid(fldPath, value, msg)) + } + return allErrs +} + func ValidatePodSpecificAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if annotations[api.AffinityAnnotationKey] != "" { @@ -110,16 +110,12 @@ func ValidatePodSpecificAnnotations(annotations map[string]string, fldPath *fiel allErrs = append(allErrs, ValidateTolerationsInPodAnnotations(annotations, fldPath)...) } + // TODO: remove these after we EOL the annotations. if hostname, exists := annotations[utilpod.PodHostnameAnnotation]; exists { - for _, msg := range validation.IsDNS1123Label(hostname) { - allErrs = append(allErrs, field.Invalid(fldPath, utilpod.PodHostnameAnnotation, msg)) - } + allErrs = append(allErrs, ValidateDNS1123Label(hostname, fldPath.Key(utilpod.PodHostnameAnnotation))...) } - if subdomain, exists := annotations[utilpod.PodSubdomainAnnotation]; exists { - for _, msg := range validation.IsDNS1123Label(subdomain) { - allErrs = append(allErrs, field.Invalid(fldPath, utilpod.PodSubdomainAnnotation, msg)) - } + allErrs = append(allErrs, ValidateDNS1123Label(subdomain, fldPath.Key(utilpod.PodSubdomainAnnotation))...) } allErrs = append(allErrs, ValidateSeccompPodAnnotations(annotations, fldPath)...) @@ -129,6 +125,7 @@ func ValidatePodSpecificAnnotations(annotations map[string]string, fldPath *fiel func ValidateEndpointsSpecificAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} + // TODO: remove this after we EOL the annotation. hostnamesMap, exists := annotations[endpoints.PodHostnamesAnnotation] if exists && !isValidHostnamesMap(hostnamesMap) { allErrs = append(allErrs, field.Invalid(fldPath, endpoints.PodHostnamesAnnotation, @@ -382,6 +379,11 @@ func ValidateObjectMetaUpdate(newMeta, oldMeta *api.ObjectMeta, fldPath *field.P allErrs = append(allErrs, field.Invalid(fldPath.Child("resourceVersion"), newMeta.ResourceVersion, "must be specified for an update")) } + // Generation shouldn't be decremented + if newMeta.Generation < oldMeta.Generation { + allErrs = append(allErrs, field.Invalid(fldPath.Child("generation"), newMeta.Generation, "must not be decremented")) + } + allErrs = append(allErrs, ValidateImmutableField(newMeta.Name, oldMeta.Name, fldPath.Child("name"))...) allErrs = append(allErrs, ValidateImmutableField(newMeta.Namespace, oldMeta.Namespace, fldPath.Child("namespace"))...) allErrs = append(allErrs, ValidateImmutableField(newMeta.UID, oldMeta.UID, fldPath.Child("uid"))...) @@ -400,15 +402,15 @@ func validateVolumes(volumes []api.Volume, fldPath *field.Path) (sets.String, fi allNames := sets.String{} for i, vol := range volumes { idxPath := fldPath.Index(i) + namePath := idxPath.Child("name") el := validateVolumeSource(&vol.VolumeSource, idxPath) if len(vol.Name) == 0 { - el = append(el, field.Required(idxPath.Child("name"), "")) - } else if msgs := validation.IsDNS1123Label(vol.Name); len(msgs) != 0 { - for i := range msgs { - el = append(el, field.Invalid(idxPath.Child("name"), vol.Name, msgs[i])) - } - } else if allNames.Has(vol.Name) { - el = append(el, field.Duplicate(idxPath.Child("name"), vol.Name)) + el = append(el, field.Required(namePath, "")) + } else { + el = append(el, ValidateDNS1123Label(vol.Name, namePath)...) + } + if allNames.Has(vol.Name) { + el = append(el, field.Duplicate(namePath, vol.Name)) } if len(el) == 0 { allNames.Insert(vol.Name) @@ -610,7 +612,7 @@ func validateISCSIVolumeSource(iscsi *api.ISCSIVolumeSource, fldPath *field.Path allErrs = append(allErrs, field.Required(fldPath.Child("iqn"), "")) } if iscsi.Lun < 0 || iscsi.Lun > 255 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("lun"), iscsi.Lun, InclusiveRangeErrorMsg(0, 255))) + allErrs = append(allErrs, field.Invalid(fldPath.Child("lun"), iscsi.Lun, validation.InclusiveRangeError(0, 255))) } return allErrs } @@ -625,7 +627,7 @@ func validateFCVolumeSource(fc *api.FCVolumeSource, fldPath *field.Path) field.E allErrs = append(allErrs, field.Required(fldPath.Child("lun"), "")) } else { if *fc.Lun < 0 || *fc.Lun > 255 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("lun"), fc.Lun, InclusiveRangeErrorMsg(0, 255))) + allErrs = append(allErrs, field.Invalid(fldPath.Child("lun"), fc.Lun, validation.InclusiveRangeError(0, 255))) } } return allErrs @@ -1020,11 +1022,18 @@ func ValidatePersistentVolumeClaim(pvc *api.PersistentVolumeClaim) field.ErrorLi func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *api.PersistentVolumeClaim) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newPvc.ObjectMeta, &oldPvc.ObjectMeta, field.NewPath("metadata")) allErrs = append(allErrs, ValidatePersistentVolumeClaim(newPvc)...) - // if a pvc had a bound volume, we should not allow updates to resources or access modes - if len(oldPvc.Spec.VolumeName) != 0 { - if !api.Semantic.DeepEqual(newPvc.Spec, oldPvc.Spec) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "spec is immutable once a claim has been bound to a volume")) - } + // PVController needs to update PVC.Spec w/ VolumeName. + // Claims are immutable in order to enforce quota, range limits, etc. without gaming the system. + if len(oldPvc.Spec.VolumeName) == 0 { + // volumeName changes are allowed once. + // Reset back to empty string after equality check + oldPvc.Spec.VolumeName = newPvc.Spec.VolumeName + defer func() { oldPvc.Spec.VolumeName = "" }() + } + // changes to Spec are not allowed, but updates to label/annotations are OK. + // no-op updates pass validation. + if !api.Semantic.DeepEqual(newPvc.Spec, oldPvc.Spec) { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "field is immutable after creation")) } newPvc.Status = oldPvc.Status return allErrs @@ -1055,8 +1064,10 @@ func validateContainerPorts(ports []api.ContainerPort, fldPath *field.Path) fiel for i, port := range ports { idxPath := fldPath.Index(i) if len(port.Name) > 0 { - if !validation.IsValidPortName(port.Name) { - allErrs = append(allErrs, field.Invalid(idxPath.Child("name"), port.Name, PortNameErrorMsg)) + if msgs := validation.IsValidPortName(port.Name); len(msgs) != 0 { + for i = range msgs { + allErrs = append(allErrs, field.Invalid(idxPath.Child("name"), port.Name, msgs[i])) + } } else if allNames.Has(port.Name) { allErrs = append(allErrs, field.Duplicate(idxPath.Child("name"), port.Name)) } else { @@ -1064,12 +1075,16 @@ func validateContainerPorts(ports []api.ContainerPort, fldPath *field.Path) fiel } } if port.ContainerPort == 0 { - allErrs = append(allErrs, field.Invalid(idxPath.Child("containerPort"), port.ContainerPort, PortRangeErrorMsg)) - } else if !validation.IsValidPortNum(int(port.ContainerPort)) { - allErrs = append(allErrs, field.Invalid(idxPath.Child("containerPort"), port.ContainerPort, PortRangeErrorMsg)) + allErrs = append(allErrs, field.Required(idxPath.Child("containerPort"), "")) + } else { + for _, msg := range validation.IsValidPortNum(int(port.ContainerPort)) { + allErrs = append(allErrs, field.Invalid(idxPath.Child("containerPort"), port.ContainerPort, msg)) + } } - if port.HostPort != 0 && !validation.IsValidPortNum(int(port.HostPort)) { - allErrs = append(allErrs, field.Invalid(idxPath.Child("hostPort"), port.HostPort, PortRangeErrorMsg)) + if port.HostPort != 0 { + for _, msg := range validation.IsValidPortNum(int(port.HostPort)) { + allErrs = append(allErrs, field.Invalid(idxPath.Child("hostPort"), port.HostPort, msg)) + } } if len(port.Protocol) == 0 { allErrs = append(allErrs, field.Required(idxPath.Child("protocol"), "")) @@ -1087,8 +1102,10 @@ func validateEnv(vars []api.EnvVar, fldPath *field.Path) field.ErrorList { idxPath := fldPath.Index(i) if len(ev.Name) == 0 { allErrs = append(allErrs, field.Required(idxPath.Child("name"), "")) - } else if !validation.IsCIdentifier(ev.Name) { - allErrs = append(allErrs, field.Invalid(idxPath.Child("name"), ev.Name, cIdentifierErrorMsg)) + } else { + for _, msg := range validation.IsCIdentifier(ev.Name) { + allErrs = append(allErrs, field.Invalid(idxPath.Child("name"), ev.Name, msg)) + } } allErrs = append(allErrs, validateEnvVarValueFrom(ev, idxPath.Child("valueFrom"))...) } @@ -1198,8 +1215,10 @@ func validateConfigMapKeySelector(s *api.ConfigMapKeySelector, fldPath *field.Pa } if len(s.Key) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("key"), "")) - } else if !IsSecretKey(s.Key) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("key"), s.Key, fmt.Sprintf("must have at most %d characters and match regex %s", validation.DNS1123SubdomainMaxLength, SecretKeyFmt))) + } else { + for _, msg := range validation.IsConfigMapKey(s.Key) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("key"), s.Key, msg)) + } } return allErrs @@ -1213,8 +1232,10 @@ func validateSecretKeySelector(s *api.SecretKeySelector, fldPath *field.Path) fi } if len(s.Key) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("key"), "")) - } else if !IsSecretKey(s.Key) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("key"), s.Key, fmt.Sprintf("must have at most %d characters and match regex %s", validation.DNS1123SubdomainMaxLength, SecretKeyFmt))) + } else { + for _, msg := range validation.IsConfigMapKey(s.Key) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("key"), s.Key, msg)) + } } return allErrs @@ -1303,36 +1324,43 @@ func validateExecAction(exec *api.ExecAction, fldPath *field.Path) field.ErrorLi return allErrors } +var supportedHTTPSchemes = sets.NewString(string(api.URISchemeHTTP), string(api.URISchemeHTTPS)) + func validateHTTPGetAction(http *api.HTTPGetAction, fldPath *field.Path) field.ErrorList { allErrors := field.ErrorList{} if len(http.Path) == 0 { allErrors = append(allErrors, field.Required(fldPath.Child("path"), "")) } - if http.Port.Type == intstr.Int && !validation.IsValidPortNum(http.Port.IntValue()) { - allErrors = append(allErrors, field.Invalid(fldPath.Child("port"), http.Port, PortRangeErrorMsg)) - } else if http.Port.Type == intstr.String && !validation.IsValidPortName(http.Port.StrVal) { - allErrors = append(allErrors, field.Invalid(fldPath.Child("port"), http.Port.StrVal, PortNameErrorMsg)) - } - supportedSchemes := sets.NewString(string(api.URISchemeHTTP), string(api.URISchemeHTTPS)) - if !supportedSchemes.Has(string(http.Scheme)) { - allErrors = append(allErrors, field.Invalid(fldPath.Child("scheme"), http.Scheme, fmt.Sprintf("must be one of %v", supportedSchemes.List()))) + allErrors = append(allErrors, ValidatePortNumOrName(http.Port, fldPath.Child("port"))...) + if !supportedHTTPSchemes.Has(string(http.Scheme)) { + allErrors = append(allErrors, field.NotSupported(fldPath.Child("scheme"), http.Scheme, supportedHTTPSchemes.List())) } for _, header := range http.HTTPHeaders { - if !validation.IsHTTPHeaderName(header.Name) { - allErrors = append(allErrors, field.Invalid(fldPath.Child("httpHeaders"), header.Name, fmt.Sprintf("name must match %s", validation.HTTPHeaderNameFmt))) + for _, msg := range validation.IsHTTPHeaderName(header.Name) { + allErrors = append(allErrors, field.Invalid(fldPath.Child("httpHeaders"), header.Name, msg)) } } return allErrors } -func validateTCPSocketAction(tcp *api.TCPSocketAction, fldPath *field.Path) field.ErrorList { - allErrors := field.ErrorList{} - if tcp.Port.Type == intstr.Int && !validation.IsValidPortNum(tcp.Port.IntValue()) { - allErrors = append(allErrors, field.Invalid(fldPath.Child("port"), tcp.Port, PortRangeErrorMsg)) - } else if tcp.Port.Type == intstr.String && !validation.IsValidPortName(tcp.Port.StrVal) { - allErrors = append(allErrors, field.Invalid(fldPath.Child("port"), tcp.Port.StrVal, PortNameErrorMsg)) +func ValidatePortNumOrName(port intstr.IntOrString, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if port.Type == intstr.Int { + for _, msg := range validation.IsValidPortNum(port.IntValue()) { + allErrs = append(allErrs, field.Invalid(fldPath, port.IntValue(), msg)) + } + } else if port.Type == intstr.String { + for _, msg := range validation.IsValidPortName(port.StrVal) { + allErrs = append(allErrs, field.Invalid(fldPath, port.StrVal, msg)) + } + } else { + allErrs = append(allErrs, field.InternalError(fldPath, fmt.Errorf("unknown type: %v", port.Type))) } - return allErrors + return allErrs +} + +func validateTCPSocketAction(tcp *api.TCPSocketAction, fldPath *field.Path) field.ErrorList { + return ValidatePortNumOrName(tcp.Port, fldPath.Child("port")) } func validateHandler(handler *api.Handler, fldPath *field.Path) field.ErrorList { @@ -1437,14 +1465,14 @@ func validateContainers(containers []api.Container, volumes sets.String, fldPath allNames := sets.String{} for i, ctr := range containers { idxPath := fldPath.Index(i) + namePath := idxPath.Child("name") if len(ctr.Name) == 0 { - allErrs = append(allErrs, field.Required(idxPath.Child("name"), "")) - } else if msgs := validation.IsDNS1123Label(ctr.Name); len(msgs) != 0 { - for i := range msgs { - allErrs = append(allErrs, field.Invalid(idxPath.Child("name"), ctr.Name, msgs[i])) - } - } else if allNames.Has(ctr.Name) { - allErrs = append(allErrs, field.Duplicate(idxPath.Child("name"), ctr.Name)) + allErrs = append(allErrs, field.Required(namePath, "")) + } else { + allErrs = append(allErrs, ValidateDNS1123Label(ctr.Name, namePath)...) + } + if allNames.Has(ctr.Name) { + allErrs = append(allErrs, field.Duplicate(namePath, ctr.Name)) } else { allNames.Insert(ctr.Name) } @@ -1633,15 +1661,11 @@ func ValidatePodSpec(spec *api.PodSpec, fldPath *field.Path) field.ErrorList { } if len(spec.Hostname) > 0 { - for _, msg := range validation.IsDNS1123Label(spec.Hostname) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("hostname"), spec.Hostname, msg)) - } + allErrs = append(allErrs, ValidateDNS1123Label(spec.Hostname, fldPath.Child("hostname"))...) } if len(spec.Subdomain) > 0 { - for _, msg := range validation.IsDNS1123Label(spec.Subdomain) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("subdomain"), spec.Subdomain, msg)) - } + allErrs = append(allErrs, ValidateDNS1123Label(spec.Subdomain, fldPath.Child("subdomain"))...) } return allErrs @@ -1881,16 +1905,19 @@ func ValidatePodSecurityContext(securityContext *api.PodSecurityContext, spec *a if securityContext != nil { allErrs = append(allErrs, validateHostNetwork(securityContext.HostNetwork, spec.Containers, specPath.Child("containers"))...) - if securityContext.FSGroup != nil && !validation.IsValidGroupId(*securityContext.FSGroup) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("fsGroup"), *(securityContext.FSGroup), IdRangeErrorMsg)) + if securityContext.FSGroup != nil { + for _, msg := range validation.IsValidGroupId(*securityContext.FSGroup) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("fsGroup"), *(securityContext.FSGroup), msg)) + } } - if securityContext.RunAsUser != nil && !validation.IsValidUserId(*securityContext.RunAsUser) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *(securityContext.RunAsUser), IdRangeErrorMsg)) + if securityContext.RunAsUser != nil { + for _, msg := range validation.IsValidUserId(*securityContext.RunAsUser) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *(securityContext.RunAsUser), msg)) + } } - for i, gid := range securityContext.SupplementalGroups { - if !validation.IsValidGroupId(gid) { - supplementalGroup := fmt.Sprintf(`supplementalGroups[%d]`, i) - allErrs = append(allErrs, field.Invalid(fldPath.Child(supplementalGroup), gid, IdRangeErrorMsg)) + for g, gid := range securityContext.SupplementalGroups { + for _, msg := range validation.IsValidGroupId(gid) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("supplementalGroups").Index(g), gid, msg)) } } } @@ -2064,10 +2091,13 @@ func ValidateService(service *api.Service) field.ErrorList { ipPath := specPath.Child("externalIPs") for i, ip := range service.Spec.ExternalIPs { idxPath := ipPath.Index(i) - if ip == "0.0.0.0" { - allErrs = append(allErrs, field.Invalid(idxPath, ip, "must be a valid IP address")) + if msgs := validation.IsValidIP(ip); len(msgs) != 0 { + for i := range msgs { + allErrs = append(allErrs, field.Invalid(idxPath, ip, msgs[i])) + } + } else { + allErrs = append(allErrs, validateNonSpecialIP(ip, idxPath)...) } - allErrs = append(allErrs, validateIpIsNotLinkLocalOrLoopback(ip, idxPath)...) } if len(service.Spec.Type) == 0 { @@ -2150,19 +2180,16 @@ func validateServicePort(sp *api.ServicePort, requireName, isHeadlessService boo if requireName && len(sp.Name) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) } else if len(sp.Name) != 0 { - if msgs := validation.IsDNS1123Label(sp.Name); len(msgs) != 0 { - for i := range msgs { - allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), sp.Name, msgs[i])) - } - } else if allNames.Has(sp.Name) { + allErrs = append(allErrs, ValidateDNS1123Label(sp.Name, fldPath.Child("name"))...) + if allNames.Has(sp.Name) { allErrs = append(allErrs, field.Duplicate(fldPath.Child("name"), sp.Name)) } else { allNames.Insert(sp.Name) } } - if !validation.IsValidPortNum(int(sp.Port)) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("port"), sp.Port, PortRangeErrorMsg)) + for _, msg := range validation.IsValidPortNum(int(sp.Port)) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("port"), sp.Port, msg)) } if len(sp.Protocol) == 0 { @@ -2171,12 +2198,7 @@ func validateServicePort(sp *api.ServicePort, requireName, isHeadlessService boo allErrs = append(allErrs, field.NotSupported(fldPath.Child("protocol"), sp.Protocol, supportedPortProtocols.List())) } - if sp.TargetPort.Type == intstr.Int && !validation.IsValidPortNum(sp.TargetPort.IntValue()) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("targetPort"), sp.TargetPort, PortRangeErrorMsg)) - } - if sp.TargetPort.Type == intstr.String && !validation.IsValidPortName(sp.TargetPort.StrVal) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("targetPort"), sp.TargetPort, PortNameErrorMsg)) - } + allErrs = append(allErrs, ValidatePortNumOrName(sp.TargetPort, fldPath.Child("targetPort"))...) // in the v1 API, targetPorts on headless services were tolerated. // once we have version-specific validation, we can reject this on newer API versions, but until then, we have to tolerate it for compatibility. @@ -2243,7 +2265,7 @@ func ValidateNonEmptySelector(selectorMap map[string]string, fldPath *field.Path return allErrs } -// Validates the given template and ensures that it is in accordance with the desrired selector and replicas. +// Validates the given template and ensures that it is in accordance with the desired selector and replicas. func ValidatePodTemplateSpecForRC(template *api.PodTemplateSpec, selectorMap map[string]string, replicas int32, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if template == nil { @@ -2442,7 +2464,7 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro // Validate resource names that can go in a resource quota // Refer to docs/design/resources.md for more details. -func validateResourceQuotaResourceName(value string, fldPath *field.Path) field.ErrorList { +func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.ErrorList { allErrs := validateResourceName(value, fldPath) if len(strings.Split(value, "/")) == 1 { if !api.IsStandardQuotaResourceName(value) { @@ -2610,16 +2632,6 @@ func ValidateServiceAccountUpdate(newServiceAccount, oldServiceAccount *api.Serv return allErrs } -const SecretKeyFmt string = "\\.?" + validation.DNS1123LabelFmt + "(\\." + validation.DNS1123LabelFmt + ")*" - -var secretKeyRegexp = regexp.MustCompile("^" + SecretKeyFmt + "$") - -// IsSecretKey tests for a string that conforms to the definition of a -// subdomain in DNS (RFC 1123), except that a leading dot is allowed -func IsSecretKey(value string) bool { - return len(value) <= validation.DNS1123SubdomainMaxLength && secretKeyRegexp.MatchString(value) -} - // ValidateSecret tests if required fields in the Secret are set. func ValidateSecret(secret *api.Secret) field.ErrorList { allErrs := ValidateObjectMeta(&secret.ObjectMeta, true, ValidateSecretName, field.NewPath("metadata")) @@ -2627,8 +2639,8 @@ func ValidateSecret(secret *api.Secret) field.ErrorList { dataPath := field.NewPath("data") totalSize := 0 for key, value := range secret.Data { - if !IsSecretKey(key) { - allErrs = append(allErrs, field.Invalid(dataPath.Key(key), key, fmt.Sprintf("must have at most %d characters and match regex %s", validation.DNS1123SubdomainMaxLength, SecretKeyFmt))) + for _, msg := range validation.IsConfigMapKey(key) { + allErrs = append(allErrs, field.Invalid(dataPath.Key(key), key, msg)) } totalSize += len(value) } @@ -2725,8 +2737,8 @@ func ValidateConfigMap(cfg *api.ConfigMap) field.ErrorList { totalSize := 0 for key, value := range cfg.Data { - if !IsSecretKey(key) { - allErrs = append(allErrs, field.Invalid(field.NewPath("data").Key(key), key, fmt.Sprintf("must have at most %d characters and match regex %s", validation.DNS1123SubdomainMaxLength, SecretKeyFmt))) + for _, msg := range validation.IsConfigMapKey(key) { + allErrs = append(allErrs, field.Invalid(field.NewPath("data").Key(key), key, msg)) } totalSize += len(value) } @@ -2788,24 +2800,24 @@ func ValidateResourceRequirements(requirements *api.ResourceRequirements, fldPat } // validateResourceQuotaScopes ensures that each enumerated hard resource constraint is valid for set of scopes -func validateResourceQuotaScopes(resourceQuota *api.ResourceQuota) field.ErrorList { +func validateResourceQuotaScopes(resourceQuotaSpec *api.ResourceQuotaSpec, fld *field.Path) field.ErrorList { allErrs := field.ErrorList{} - if len(resourceQuota.Spec.Scopes) == 0 { + if len(resourceQuotaSpec.Scopes) == 0 { return allErrs } hardLimits := sets.NewString() - for k := range resourceQuota.Spec.Hard { + for k := range resourceQuotaSpec.Hard { hardLimits.Insert(string(k)) } - fldPath := field.NewPath("spec", "scopes") + fldPath := fld.Child("scopes") scopeSet := sets.NewString() - for _, scope := range resourceQuota.Spec.Scopes { + for _, scope := range resourceQuotaSpec.Scopes { if !api.IsStandardResourceQuotaScope(string(scope)) { - allErrs = append(allErrs, field.Invalid(fldPath, resourceQuota.Spec.Scopes, "unsupported scope")) + allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "unsupported scope")) } for _, k := range hardLimits.List() { if api.IsStandardQuotaResourceName(k) && !api.IsResourceQuotaScopeValidForResource(scope, k) { - allErrs = append(allErrs, field.Invalid(fldPath, resourceQuota.Spec.Scopes, "unsupported scope applied to resource")) + allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "unsupported scope applied to resource")) } } scopeSet.Insert(string(scope)) @@ -2816,7 +2828,7 @@ func validateResourceQuotaScopes(resourceQuota *api.ResourceQuota) field.ErrorLi } for _, invalidScopePair := range invalidScopePairs { if scopeSet.HasAll(invalidScopePair.List()...) { - allErrs = append(allErrs, field.Invalid(fldPath, resourceQuota.Spec.Scopes, "conflicting scopes")) + allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "conflicting scopes")) } } return allErrs @@ -2826,32 +2838,47 @@ func validateResourceQuotaScopes(resourceQuota *api.ResourceQuota) field.ErrorLi func ValidateResourceQuota(resourceQuota *api.ResourceQuota) field.ErrorList { allErrs := ValidateObjectMeta(&resourceQuota.ObjectMeta, true, ValidateResourceQuotaName, field.NewPath("metadata")) - fldPath := field.NewPath("spec", "hard") - for k, v := range resourceQuota.Spec.Hard { - resPath := fldPath.Key(string(k)) - allErrs = append(allErrs, validateResourceQuotaResourceName(string(k), resPath)...) - allErrs = append(allErrs, validateResourceQuantityValue(string(k), v, resPath)...) - } - allErrs = append(allErrs, validateResourceQuotaScopes(resourceQuota)...) + allErrs = append(allErrs, ValidateResourceQuotaSpec(&resourceQuota.Spec, field.NewPath("spec"))...) + allErrs = append(allErrs, ValidateResourceQuotaStatus(&resourceQuota.Status, field.NewPath("status"))...) - fldPath = field.NewPath("status", "hard") - for k, v := range resourceQuota.Status.Hard { + return allErrs +} + +func ValidateResourceQuotaStatus(status *api.ResourceQuotaStatus, fld *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + fldPath := fld.Child("hard") + for k, v := range status.Hard { resPath := fldPath.Key(string(k)) - allErrs = append(allErrs, validateResourceQuotaResourceName(string(k), resPath)...) - allErrs = append(allErrs, validateResourceQuantityValue(string(k), v, resPath)...) + allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...) } - fldPath = field.NewPath("status", "used") - for k, v := range resourceQuota.Status.Used { + fldPath = fld.Child("used") + for k, v := range status.Used { resPath := fldPath.Key(string(k)) - allErrs = append(allErrs, validateResourceQuotaResourceName(string(k), resPath)...) - allErrs = append(allErrs, validateResourceQuantityValue(string(k), v, resPath)...) + allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...) } return allErrs } -// validateResourceQuantityValue enforces that specified quantity is valid for specified resource -func validateResourceQuantityValue(resource string, value resource.Quantity, fldPath *field.Path) field.ErrorList { +func ValidateResourceQuotaSpec(resourceQuotaSpec *api.ResourceQuotaSpec, fld *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + fldPath := fld.Child("hard") + for k, v := range resourceQuotaSpec.Hard { + resPath := fldPath.Key(string(k)) + allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...) + } + allErrs = append(allErrs, validateResourceQuotaScopes(resourceQuotaSpec, fld)...) + + return allErrs +} + +// ValidateResourceQuantityValue enforces that specified quantity is valid for specified resource +func ValidateResourceQuantityValue(resource string, value resource.Quantity, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} allErrs = append(allErrs, ValidateNonnegativeQuantity(value, fldPath)...) if api.IsIntegerResourceName(resource) { @@ -2866,15 +2893,10 @@ func validateResourceQuantityValue(resource string, value resource.Quantity, fld // newResourceQuota is updated with fields that cannot be changed. func ValidateResourceQuotaUpdate(newResourceQuota, oldResourceQuota *api.ResourceQuota) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newResourceQuota.ObjectMeta, &oldResourceQuota.ObjectMeta, field.NewPath("metadata")) - fldPath := field.NewPath("spec", "hard") - for k, v := range newResourceQuota.Spec.Hard { - resPath := fldPath.Key(string(k)) - allErrs = append(allErrs, validateResourceQuotaResourceName(string(k), resPath)...) - allErrs = append(allErrs, validateResourceQuantityValue(string(k), v, resPath)...) - } + allErrs = append(allErrs, ValidateResourceQuotaSpec(&newResourceQuota.Spec, field.NewPath("spec"))...) // ensure scopes cannot change, and that resources are still valid for scope - fldPath = field.NewPath("spec", "scopes") + fldPath := field.NewPath("spec", "scopes") oldScopes := sets.NewString() newScopes := sets.NewString() for _, scope := range newResourceQuota.Spec.Scopes { @@ -2886,7 +2908,6 @@ func ValidateResourceQuotaUpdate(newResourceQuota, oldResourceQuota *api.Resourc if !oldScopes.Equal(newScopes) { allErrs = append(allErrs, field.Invalid(fldPath, newResourceQuota.Spec.Scopes, "field is immutable")) } - allErrs = append(allErrs, validateResourceQuotaScopes(newResourceQuota)...) newResourceQuota.Status = oldResourceQuota.Status return allErrs @@ -2902,14 +2923,14 @@ func ValidateResourceQuotaStatusUpdate(newResourceQuota, oldResourceQuota *api.R fldPath := field.NewPath("status", "hard") for k, v := range newResourceQuota.Status.Hard { resPath := fldPath.Key(string(k)) - allErrs = append(allErrs, validateResourceQuotaResourceName(string(k), resPath)...) - allErrs = append(allErrs, validateResourceQuantityValue(string(k), v, resPath)...) + allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...) } fldPath = field.NewPath("status", "used") for k, v := range newResourceQuota.Status.Used { resPath := fldPath.Key(string(k)) - allErrs = append(allErrs, validateResourceQuotaResourceName(string(k), resPath)...) - allErrs = append(allErrs, validateResourceQuantityValue(string(k), v, resPath)...) + allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...) } newResourceQuota.Spec = oldResourceQuota.Spec return allErrs @@ -3021,29 +3042,33 @@ func validateEndpointSubsets(subsets []api.EndpointSubset, fldPath *field.Path) func validateEndpointAddress(address *api.EndpointAddress, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - if !validation.IsValidIP(address.IP) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("ip"), address.IP, "must be a valid IP address")) + for _, msg := range validation.IsValidIP(address.IP) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("ip"), address.IP, msg)) } if len(address.Hostname) > 0 { - for _, msg := range validation.IsDNS1123Label(address.Hostname) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("hostname"), address.Hostname, msg)) - } + allErrs = append(allErrs, ValidateDNS1123Label(address.Hostname, fldPath.Child("hostname"))...) } if len(allErrs) > 0 { return allErrs } - return validateIpIsNotLinkLocalOrLoopback(address.IP, fldPath.Child("ip")) + allErrs = append(allErrs, validateNonSpecialIP(address.IP, fldPath.Child("ip"))...) + return allErrs } -func validateIpIsNotLinkLocalOrLoopback(ipAddress string, fldPath *field.Path) field.ErrorList { - // We disallow some IPs as endpoints or external-ips. Specifically, loopback addresses are - // nonsensical and link-local addresses tend to be used for node-centric purposes (e.g. metadata service). +func validateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList { + // We disallow some IPs as endpoints or external-ips. Specifically, + // unspecified and loopback addresses are nonsensical and link-local + // addresses tend to be used for node-centric purposes (e.g. metadata + // service). allErrs := field.ErrorList{} ip := net.ParseIP(ipAddress) if ip == nil { allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "must be a valid IP address")) return allErrs } + if ip.IsUnspecified() { + allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be unspecified (0.0.0.0)")) + } if ip.IsLoopback() { allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the loopback range (127.0.0.0/8)")) } @@ -3061,12 +3086,10 @@ func validateEndpointPort(port *api.EndpointPort, requireName bool, fldPath *fie if requireName && len(port.Name) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) } else if len(port.Name) != 0 { - for _, msg := range validation.IsDNS1123Label(port.Name) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), port.Name, msg)) - } + allErrs = append(allErrs, ValidateDNS1123Label(port.Name, fldPath.Child("name"))...) } - if !validation.IsValidPortNum(int(port.Port)) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("port"), port.Port, PortRangeErrorMsg)) + for _, msg := range validation.IsValidPortNum(int(port.Port)) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("port"), port.Port, msg)) } if len(port.Protocol) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("protocol"), "")) @@ -3147,6 +3170,7 @@ func ValidateLoadBalancerStatus(status *api.LoadBalancerStatus, fldPath *field.P return allErrs } +// TODO: remove this after we EOL the annotation that carries it. func isValidHostnamesMap(serializedPodHostNames string) bool { if len(serializedPodHostNames) == 0 { return false diff --git a/vendor/k8s.io/kubernetes/pkg/apimachinery/doc.go b/vendor/k8s.io/kubernetes/pkg/apimachinery/doc.go index 7c5a261b4..ede22b3d6 100644 --- a/vendor/k8s.io/kubernetes/pkg/apimachinery/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apimachinery/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/apimachinery/registered/registered.go b/vendor/k8s.io/kubernetes/pkg/apimachinery/registered/registered.go index c418de3b0..307f55da0 100644 --- a/vendor/k8s.io/kubernetes/pkg/apimachinery/registered/registered.go +++ b/vendor/k8s.io/kubernetes/pkg/apimachinery/registered/registered.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apimachinery/types.go b/vendor/k8s.io/kubernetes/pkg/apimachinery/types.go index 3e86921ce..0e90cbbe3 100644 --- a/vendor/k8s.io/kubernetes/pkg/apimachinery/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apimachinery/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/deep_copy_generated.go index 5a2135c6a..bdeb0b19c 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -39,9 +39,7 @@ func init() { } func DeepCopy_apps_PetSet(in PetSet, out *PetSet, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -55,12 +53,8 @@ func DeepCopy_apps_PetSet(in PetSet, out *PetSet, c *conversion.Cloner) error { } func DeepCopy_apps_PetSetList(in PetSetList, out *PetSetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PetSet, len(in)) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go new file mode 100644 index 000000000..bca1ff4ef --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package apps diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/install/install.go index b4d9011d3..346740e44 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/register.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/register.go index dd5b9a900..90acc1231 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/types.generated.go index a08450922..be8a54ad5 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go index f140cab96..c3e28972f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion.go index 48f1f2b4d..b2fb1be72 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion_generated.go index cfd6ce44b..3cf472810 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/deep_copy_generated.go index 6e51cacbc..871894214 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -40,9 +40,7 @@ func init() { } func DeepCopy_v1alpha1_PetSet(in PetSet, out *PetSet, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -56,12 +54,8 @@ func DeepCopy_v1alpha1_PetSet(in PetSet, out *PetSet, c *conversion.Cloner) erro } func DeepCopy_v1alpha1_PetSetList(in PetSetList, out *PetSetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PetSet, len(in)) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/defaults.go index e41028138..e578e8c94 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/doc.go index 65a03a209..53d9fcabc 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps + package v1alpha1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.pb.go index 88f1bcd40..7e76067e4 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.proto index 6cb15bf3f..92bdd6b31 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/register.go index e06980775..9fd138c4a 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ func addKnownTypes(scheme *runtime.Scheme) { &PetSet{}, &PetSetList{}, &v1.ListOptions{}, + &v1.DeleteOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.generated.go index a544c4e6a..d03639227 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.go index 5306483ab..93a0c66e4 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go index 6306b4812..5191f1224 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/deep_copy_generated.go index 75ac7281e..6424875d5 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package authentication import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" ) @@ -39,12 +38,8 @@ func init() { } func DeepCopy_authenticationk8sio_TokenReview(in TokenReview, out *TokenReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := DeepCopy_authenticationk8sio_TokenReviewSpec(in.Spec, &out.Spec, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.Spec = in.Spec if err := DeepCopy_authenticationk8sio_TokenReviewStatus(in.Status, &out.Status, c); err != nil { return err } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/doc.go new file mode 100644 index 000000000..66c5ae720 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package authentication diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install/install.go index 29447d217..e021ea88f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/register.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/register.go index 4dda3140f..57394fcbc 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.generated.go index b3b72d653..b666e8c18 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.go index 02ec0d2b2..20eac2bf7 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion.go index 6a8545d13..e360ee8a2 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go index 9972f82ed..d60db5ed9 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go index e44dfc86b..d3294bfc8 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package v1beta1 import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" ) @@ -39,12 +38,8 @@ func init() { } func DeepCopy_v1beta1_TokenReview(in TokenReview, out *TokenReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_TokenReviewSpec(in.Spec, &out.Spec, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.Spec = in.Spec if err := DeepCopy_v1beta1_TokenReviewStatus(in.Status, &out.Status, c); err != nil { return err } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/defaults.go index 0f3732e36..83794ff7b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/doc.go index cfdb87c53..25b76fd34 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/authentication.k8s.io + package v1beta1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/register.go index e183299c0..511793653 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.generated.go index 62d287ff5..60eeab9eb 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.go index fc136877a..ee3220672 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/deep_copy_generated.go index bc40fb33e..5e92552c0 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package authorization import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" ) @@ -43,15 +42,11 @@ func init() { } func DeepCopy_authorization_LocalSubjectAccessReview(in LocalSubjectAccessReview, out *LocalSubjectAccessReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_authorization_SubjectAccessReviewSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_authorization_SubjectAccessReviewStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } @@ -73,15 +68,11 @@ func DeepCopy_authorization_ResourceAttributes(in ResourceAttributes, out *Resou } func DeepCopy_authorization_SelfSubjectAccessReview(in SelfSubjectAccessReview, out *SelfSubjectAccessReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_authorization_SelfSubjectAccessReviewSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_authorization_SubjectAccessReviewStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } @@ -89,18 +80,14 @@ func DeepCopy_authorization_SelfSubjectAccessReviewSpec(in SelfSubjectAccessRevi if in.ResourceAttributes != nil { in, out := in.ResourceAttributes, &out.ResourceAttributes *out = new(ResourceAttributes) - if err := DeepCopy_authorization_ResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ResourceAttributes = nil } if in.NonResourceAttributes != nil { in, out := in.NonResourceAttributes, &out.NonResourceAttributes *out = new(NonResourceAttributes) - if err := DeepCopy_authorization_NonResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NonResourceAttributes = nil } @@ -108,15 +95,11 @@ func DeepCopy_authorization_SelfSubjectAccessReviewSpec(in SelfSubjectAccessRevi } func DeepCopy_authorization_SubjectAccessReview(in SubjectAccessReview, out *SubjectAccessReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_authorization_SubjectAccessReviewSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_authorization_SubjectAccessReviewStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } @@ -124,18 +107,14 @@ func DeepCopy_authorization_SubjectAccessReviewSpec(in SubjectAccessReviewSpec, if in.ResourceAttributes != nil { in, out := in.ResourceAttributes, &out.ResourceAttributes *out = new(ResourceAttributes) - if err := DeepCopy_authorization_ResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ResourceAttributes = nil } if in.NonResourceAttributes != nil { in, out := in.NonResourceAttributes, &out.NonResourceAttributes *out = new(NonResourceAttributes) - if err := DeepCopy_authorization_NonResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NonResourceAttributes = nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/doc.go new file mode 100644 index 000000000..9660e5eac --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package authorization diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/install/install.go index bf8814dd5..789981559 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/register.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/register.go index fdb6c4f4b..b1cfa491b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.generated.go index 1c071376c..a0811c8a7 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.go index 8cfdfbe97..afa2c4273 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion.go index 0b45ed5fb..cd03e61b0 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go index a475c0fd0..18d11380b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/deep_copy_generated.go index 94a35650c..23d2edf03 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package v1beta1 import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" ) @@ -43,15 +42,11 @@ func init() { } func DeepCopy_v1beta1_LocalSubjectAccessReview(in LocalSubjectAccessReview, out *LocalSubjectAccessReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1beta1_SubjectAccessReviewSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1beta1_SubjectAccessReviewStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } @@ -73,15 +68,11 @@ func DeepCopy_v1beta1_ResourceAttributes(in ResourceAttributes, out *ResourceAtt } func DeepCopy_v1beta1_SelfSubjectAccessReview(in SelfSubjectAccessReview, out *SelfSubjectAccessReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1beta1_SelfSubjectAccessReviewSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1beta1_SubjectAccessReviewStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } @@ -89,18 +80,14 @@ func DeepCopy_v1beta1_SelfSubjectAccessReviewSpec(in SelfSubjectAccessReviewSpec if in.ResourceAttributes != nil { in, out := in.ResourceAttributes, &out.ResourceAttributes *out = new(ResourceAttributes) - if err := DeepCopy_v1beta1_ResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ResourceAttributes = nil } if in.NonResourceAttributes != nil { in, out := in.NonResourceAttributes, &out.NonResourceAttributes *out = new(NonResourceAttributes) - if err := DeepCopy_v1beta1_NonResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NonResourceAttributes = nil } @@ -108,15 +95,11 @@ func DeepCopy_v1beta1_SelfSubjectAccessReviewSpec(in SelfSubjectAccessReviewSpec } func DeepCopy_v1beta1_SubjectAccessReview(in SubjectAccessReview, out *SubjectAccessReview, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := DeepCopy_v1beta1_SubjectAccessReviewSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1beta1_SubjectAccessReviewStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } @@ -124,18 +107,14 @@ func DeepCopy_v1beta1_SubjectAccessReviewSpec(in SubjectAccessReviewSpec, out *S if in.ResourceAttributes != nil { in, out := in.ResourceAttributes, &out.ResourceAttributes *out = new(ResourceAttributes) - if err := DeepCopy_v1beta1_ResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.ResourceAttributes = nil } if in.NonResourceAttributes != nil { in, out := in.NonResourceAttributes, &out.NonResourceAttributes *out = new(NonResourceAttributes) - if err := DeepCopy_v1beta1_NonResourceAttributes(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.NonResourceAttributes = nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/defaults.go index 340f80755..f9dda995e 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/doc.go index cfdb87c53..a6f2c27b1 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/authorization + package v1beta1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/register.go index d9e33ed5a..fe99bee3f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.generated.go index 3b5e4fbe9..0bd74a1bb 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.go index 27078e9fc..70c1282a7 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types_swagger_doc_generated.go index d4c337db7..dc934768d 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/deep_copy_generated.go index d78bad7cb..1ddcc135b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -50,9 +50,7 @@ func DeepCopy_autoscaling_CrossVersionObjectReference(in CrossVersionObjectRefer } func DeepCopy_autoscaling_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -66,12 +64,8 @@ func DeepCopy_autoscaling_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, ou } func DeepCopy_autoscaling_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]HorizontalPodAutoscaler, len(in)) @@ -87,9 +81,7 @@ func DeepCopy_autoscaling_HorizontalPodAutoscalerList(in HorizontalPodAutoscaler } func DeepCopy_autoscaling_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, c *conversion.Cloner) error { - if err := DeepCopy_autoscaling_CrossVersionObjectReference(in.ScaleTargetRef, &out.ScaleTargetRef, c); err != nil { - return err - } + out.ScaleTargetRef = in.ScaleTargetRef if in.MinReplicas != nil { in, out := in.MinReplicas, &out.MinReplicas *out = new(int32) @@ -119,9 +111,7 @@ func DeepCopy_autoscaling_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscal if in.LastScaleTime != nil { in, out := in.LastScaleTime, &out.LastScaleTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.LastScaleTime = nil } @@ -138,18 +128,12 @@ func DeepCopy_autoscaling_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscal } func DeepCopy_autoscaling_Scale(in Scale, out *Scale, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_autoscaling_ScaleSpec(in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_autoscaling_ScaleStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Spec = in.Spec + out.Status = in.Status return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go new file mode 100644 index 000000000..2c770186b --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package autoscaling diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/install.go index 6e226a066..be236ff0e 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/register.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/register.go index 6a4fb747b..ee0d3c75b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.generated.go index fdd059190..ded722784 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go index 3e60def92..6accc9fd4 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/conversion_generated.go index 11ca6a056..3d5699283 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/deep_copy_generated.go index 6932ba638..af0245eb3 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -51,9 +51,7 @@ func DeepCopy_v1_CrossVersionObjectReference(in CrossVersionObjectReference, out } func DeepCopy_v1_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api_v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -67,12 +65,8 @@ func DeepCopy_v1_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *Horizo } func DeepCopy_v1_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]HorizontalPodAutoscaler, len(in)) @@ -88,9 +82,7 @@ func DeepCopy_v1_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList, out } func DeepCopy_v1_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, c *conversion.Cloner) error { - if err := DeepCopy_v1_CrossVersionObjectReference(in.ScaleTargetRef, &out.ScaleTargetRef, c); err != nil { - return err - } + out.ScaleTargetRef = in.ScaleTargetRef if in.MinReplicas != nil { in, out := in.MinReplicas, &out.MinReplicas *out = new(int32) @@ -120,9 +112,7 @@ func DeepCopy_v1_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerStatus, if in.LastScaleTime != nil { in, out := in.LastScaleTime, &out.LastScaleTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.LastScaleTime = nil } @@ -139,18 +129,12 @@ func DeepCopy_v1_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerStatus, } func DeepCopy_v1_Scale(in Scale, out *Scale, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api_v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_v1_ScaleSpec(in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1_ScaleStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Spec = in.Spec + out.Status = in.Status return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/defaults.go index 3fb24c46b..aacf552fc 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/doc.go index 1c67cc3a9..be1c70fdb 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling + package v1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.pb.go index e90dd5d62..f44b843b9 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.proto index 7905f68a8..7730d6e91 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/register.go index bed584f0d..93d9535e4 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ func addKnownTypes(scheme *runtime.Scheme) { &HorizontalPodAutoscalerList{}, &Scale{}, &v1.ListOptions{}, + &v1.DeleteOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.generated.go index d8401bb8b..ab9ebc512 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.go index 227e25703..035288cb2 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types_swagger_doc_generated.go index 6e6374570..6b9bcf47e 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/deep_copy_generated.go index 6e08ec410..a6adac467 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -46,9 +46,7 @@ func init() { } func DeepCopy_batch_Job(in Job, out *Job, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -64,24 +62,16 @@ func DeepCopy_batch_Job(in Job, out *Job, c *conversion.Cloner) error { func DeepCopy_batch_JobCondition(in JobCondition, out *JobCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_batch_JobList(in JobList, out *JobList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Job, len(in)) @@ -155,18 +145,14 @@ func DeepCopy_batch_JobStatus(in JobStatus, out *JobStatus, c *conversion.Cloner if in.StartTime != nil { in, out := in.StartTime, &out.StartTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.StartTime = nil } if in.CompletionTime != nil { in, out := in.CompletionTime, &out.CompletionTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.CompletionTime = nil } @@ -177,9 +163,7 @@ func DeepCopy_batch_JobStatus(in JobStatus, out *JobStatus, c *conversion.Cloner } func DeepCopy_batch_JobTemplate(in JobTemplate, out *JobTemplate, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -200,9 +184,7 @@ func DeepCopy_batch_JobTemplateSpec(in JobTemplateSpec, out *JobTemplateSpec, c } func DeepCopy_batch_ScheduledJob(in ScheduledJob, out *ScheduledJob, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -216,12 +198,8 @@ func DeepCopy_batch_ScheduledJob(in ScheduledJob, out *ScheduledJob, c *conversi } func DeepCopy_batch_ScheduledJobList(in ScheduledJobList, out *ScheduledJobList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ScheduledJob, len(in)) @@ -264,9 +242,7 @@ func DeepCopy_batch_ScheduledJobStatus(in ScheduledJobStatus, out *ScheduledJobS in, out := in.Active, &out.Active *out = make([]api.ObjectReference, len(in)) for i := range in { - if err := api.DeepCopy_api_ObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Active = nil @@ -274,9 +250,7 @@ func DeepCopy_batch_ScheduledJobStatus(in ScheduledJobStatus, out *ScheduledJobS if in.LastScheduleTime != nil { in, out := in.LastScheduleTime, &out.LastScheduleTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.LastScheduleTime = nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go new file mode 100644 index 000000000..c6b203cd8 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package batch diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/install/install.go index 9d1a88603..22f92b708 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/register.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/register.go index cafa3fd89..641df5f39 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/types.generated.go index 14c44a0f8..03f0d248c 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go index 6507c56a6..61a35d47f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion.go index 2d163c6e9..8846af1ed 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion_generated.go index 4bb13c498..88e6d961f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/deep_copy_generated.go index c2a50b4ee..53d4eab00 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -43,9 +43,7 @@ func init() { } func DeepCopy_v1_Job(in Job, out *Job, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api_v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -61,24 +59,16 @@ func DeepCopy_v1_Job(in Job, out *Job, c *conversion.Cloner) error { func DeepCopy_v1_JobCondition(in JobCondition, out *JobCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_v1_JobList(in JobList, out *JobList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Job, len(in)) @@ -152,18 +142,14 @@ func DeepCopy_v1_JobStatus(in JobStatus, out *JobStatus, c *conversion.Cloner) e if in.StartTime != nil { in, out := in.StartTime, &out.StartTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.StartTime = nil } if in.CompletionTime != nil { in, out := in.CompletionTime, &out.CompletionTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.CompletionTime = nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/defaults.go index 81aa90c1d..571d2c524 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/doc.go index 1c67cc3a9..5695b9e40 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/batch + package v1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.pb.go index 95646919d..d3649ef66 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.proto index 5c01754ce..75840ed78 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/register.go index 3a5e1cfe3..3631c02d1 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ func addKnownTypes(scheme *runtime.Scheme) { &Job{}, &JobList{}, &v1.ListOptions{}, + &v1.DeleteOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.generated.go index 58d5f6f54..a44952c7a 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.go index 47ed77524..a821e9366 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types_swagger_doc_generated.go index 3e758b009..aa0dbcc2f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion.go index 4714fda0f..2d5710a23 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion_generated.go index c411875e3..3265269bd 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/deep_copy_generated.go index 92cb71ea0..baa1b5964 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,9 +49,7 @@ func init() { } func DeepCopy_v2alpha1_Job(in Job, out *Job, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -67,24 +65,16 @@ func DeepCopy_v2alpha1_Job(in Job, out *Job, c *conversion.Cloner) error { func DeepCopy_v2alpha1_JobCondition(in JobCondition, out *JobCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_v2alpha1_JobList(in JobList, out *JobList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Job, len(in)) @@ -158,18 +148,14 @@ func DeepCopy_v2alpha1_JobStatus(in JobStatus, out *JobStatus, c *conversion.Clo if in.StartTime != nil { in, out := in.StartTime, &out.StartTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.StartTime = nil } if in.CompletionTime != nil { in, out := in.CompletionTime, &out.CompletionTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.CompletionTime = nil } @@ -180,9 +166,7 @@ func DeepCopy_v2alpha1_JobStatus(in JobStatus, out *JobStatus, c *conversion.Clo } func DeepCopy_v2alpha1_JobTemplate(in JobTemplate, out *JobTemplate, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -240,9 +224,7 @@ func DeepCopy_v2alpha1_LabelSelectorRequirement(in LabelSelectorRequirement, out } func DeepCopy_v2alpha1_ScheduledJob(in ScheduledJob, out *ScheduledJob, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -256,12 +238,8 @@ func DeepCopy_v2alpha1_ScheduledJob(in ScheduledJob, out *ScheduledJob, c *conve } func DeepCopy_v2alpha1_ScheduledJobList(in ScheduledJobList, out *ScheduledJobList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ScheduledJob, len(in)) @@ -304,9 +282,7 @@ func DeepCopy_v2alpha1_ScheduledJobStatus(in ScheduledJobStatus, out *ScheduledJ in, out := in.Active, &out.Active *out = make([]v1.ObjectReference, len(in)) for i := range in { - if err := v1.DeepCopy_v1_ObjectReference(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Active = nil @@ -314,9 +290,7 @@ func DeepCopy_v2alpha1_ScheduledJobStatus(in ScheduledJobStatus, out *ScheduledJ if in.LastScheduleTime != nil { in, out := in.LastScheduleTime, &out.LastScheduleTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.LastScheduleTime = nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/defaults.go index 72da797c7..a7d24ceac 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/doc.go index 0e6b67b58..76b5d3251 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/batch + package v2alpha1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.pb.go index 17192c01c..a461a47eb 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.proto index 7780bef31..41e200177 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/register.go index 1c33ab678..54f0d6290 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -44,6 +44,7 @@ func addKnownTypes(scheme *runtime.Scheme) { &ScheduledJob{}, &ScheduledJobList{}, &v1.ListOptions{}, + &v1.DeleteOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.generated.go index 341d1d217..bd48550ca 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.go index 4575bc804..0402df2e8 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go index 7f0e3b199..17d43318d 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/deep_copy_generated.go new file mode 100644 index 000000000..07b1b2d4d --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/deep_copy_generated.go @@ -0,0 +1,120 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by deepcopy-gen. Do not edit it manually! + +package certificates + +import ( + api "k8s.io/kubernetes/pkg/api" + conversion "k8s.io/kubernetes/pkg/conversion" +) + +func init() { + if err := api.Scheme.AddGeneratedDeepCopyFuncs( + DeepCopy_certificates_CertificateSigningRequest, + DeepCopy_certificates_CertificateSigningRequestCondition, + DeepCopy_certificates_CertificateSigningRequestList, + DeepCopy_certificates_CertificateSigningRequestSpec, + DeepCopy_certificates_CertificateSigningRequestStatus, + ); err != nil { + // if one of the deep copy functions is malformed, detect it immediately. + panic(err) + } +} + +func DeepCopy_certificates_CertificateSigningRequest(in CertificateSigningRequest, out *CertificateSigningRequest, c *conversion.Cloner) error { + out.TypeMeta = in.TypeMeta + if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + return err + } + if err := DeepCopy_certificates_CertificateSigningRequestSpec(in.Spec, &out.Spec, c); err != nil { + return err + } + if err := DeepCopy_certificates_CertificateSigningRequestStatus(in.Status, &out.Status, c); err != nil { + return err + } + return nil +} + +func DeepCopy_certificates_CertificateSigningRequestCondition(in CertificateSigningRequestCondition, out *CertificateSigningRequestCondition, c *conversion.Cloner) error { + out.Type = in.Type + out.Reason = in.Reason + out.Message = in.Message + out.LastUpdateTime = in.LastUpdateTime.DeepCopy() + return nil +} + +func DeepCopy_certificates_CertificateSigningRequestList(in CertificateSigningRequestList, out *CertificateSigningRequestList, c *conversion.Cloner) error { + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := in.Items, &out.Items + *out = make([]CertificateSigningRequest, len(in)) + for i := range in { + if err := DeepCopy_certificates_CertificateSigningRequest(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func DeepCopy_certificates_CertificateSigningRequestSpec(in CertificateSigningRequestSpec, out *CertificateSigningRequestSpec, c *conversion.Cloner) error { + if in.Request != nil { + in, out := in.Request, &out.Request + *out = make([]byte, len(in)) + copy(*out, in) + } else { + out.Request = nil + } + out.Username = in.Username + out.UID = in.UID + if in.Groups != nil { + in, out := in.Groups, &out.Groups + *out = make([]string, len(in)) + copy(*out, in) + } else { + out.Groups = nil + } + return nil +} + +func DeepCopy_certificates_CertificateSigningRequestStatus(in CertificateSigningRequestStatus, out *CertificateSigningRequestStatus, c *conversion.Cloner) error { + if in.Conditions != nil { + in, out := in.Conditions, &out.Conditions + *out = make([]CertificateSigningRequestCondition, len(in)) + for i := range in { + if err := DeepCopy_certificates_CertificateSigningRequestCondition(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if in.Certificate != nil { + in, out := in.Certificate, &out.Certificate + *out = make([]byte, len(in)) + copy(*out, in) + } else { + out.Certificate = nil + } + return nil +} diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/doc.go new file mode 100644 index 000000000..d2897cb87 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package certificates diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/install/install.go new file mode 100644 index 000000000..cf54da430 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/install/install.go @@ -0,0 +1,131 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package install installs the certificates API group, making it available as +// an option to all of the API encoding/decoding machinery. +package install + +import ( + "fmt" + + "github.com/golang/glog" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/meta" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/apimachinery" + "k8s.io/kubernetes/pkg/apimachinery/registered" + "k8s.io/kubernetes/pkg/apis/certificates" + "k8s.io/kubernetes/pkg/apis/certificates/v1alpha1" + "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/util/sets" +) + +const importPrefix = "k8s.io/kubernetes/pkg/apis/certificates" + +var accessor = meta.NewAccessor() + +// availableVersions lists all known external versions for this group from most preferred to least preferred +var availableVersions = []unversioned.GroupVersion{v1alpha1.SchemeGroupVersion} + +func init() { + registered.RegisterVersions(availableVersions) + externalVersions := []unversioned.GroupVersion{} + for _, v := range availableVersions { + if registered.IsAllowedVersion(v) { + externalVersions = append(externalVersions, v) + } + } + if len(externalVersions) == 0 { + glog.V(4).Infof("No version is registered for group %v", certificates.GroupName) + return + } + + if err := registered.EnableVersions(externalVersions...); err != nil { + glog.V(4).Infof("%v", err) + return + } + if err := enableVersions(externalVersions); err != nil { + glog.V(4).Infof("%v", err) + return + } +} + +// TODO: enableVersions should be centralized rather than spread in each API +// group. +// We can combine registered.RegisterVersions, registered.EnableVersions and +// registered.RegisterGroup once we have moved enableVersions therecertificates +func enableVersions(externalVersions []unversioned.GroupVersion) error { + addVersionsToScheme(externalVersions...) + preferredExternalVersion := externalVersions[0] + + groupMeta := apimachinery.GroupMeta{ + GroupVersion: preferredExternalVersion, + GroupVersions: externalVersions, + RESTMapper: newRESTMapper(externalVersions), + SelfLinker: runtime.SelfLinker(accessor), + InterfacesFor: interfacesFor, + } + + if err := registered.RegisterGroup(groupMeta); err != nil { + return err + } + api.RegisterRESTMapper(groupMeta.RESTMapper) + return nil +} + +func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper { + // the list of kinds that are scoped at the root of the api hierarchy + // if a kind is not enumerated here, it is assumed to have a namespace scope + rootScoped := sets.NewString( + "CertificateSigningRequest", + ) + + ignoredKinds := sets.NewString() + + return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped) +} + +// interfacesFor returns the default Codec and ResourceVersioner for a given version +// string, or an error if the version is not known. +func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) { + switch version { + case v1alpha1.SchemeGroupVersion: + return &meta.VersionInterfaces{ + ObjectConvertor: api.Scheme, + MetadataAccessor: accessor, + }, nil + default: + g, _ := registered.Group(certificates.GroupName) + return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions) + } +} + +func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) { + // add the internal version to Scheme + certificates.AddToScheme(api.Scheme) + // add the enabled external versions to Scheme + for _, v := range externalVersions { + if !registered.IsEnabledVersion(v) { + glog.Errorf("Version %s is not enabled, so it will not be added to the Scheme.", v) + continue + } + switch v { + case v1alpha1.SchemeGroupVersion: + v1alpha1.AddToScheme(api.Scheme) + } + } +} diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/register.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/register.go new file mode 100644 index 000000000..d232b3c86 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/register.go @@ -0,0 +1,57 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package certificates + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/runtime" +) + +// GroupName is the group name use in this package +const GroupName = "certificates" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) unversioned.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns back a Group qualified GroupResource +func Resource(resource string) unversioned.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +func AddToScheme(scheme *runtime.Scheme) { + // Add the API to Scheme. + addKnownTypes(scheme) +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) { + scheme.AddKnownTypes(SchemeGroupVersion, + &CertificateSigningRequest{}, + &CertificateSigningRequestList{}, + &api.ListOptions{}, + &api.DeleteOptions{}, + ) +} + +func (obj *CertificateSigningRequest) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *CertificateSigningRequestList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/types.generated.go new file mode 100644 index 000000000..21798df3c --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/types.generated.go @@ -0,0 +1,1963 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// ************************************************************ +// DO NOT EDIT. +// THIS FILE IS AUTO-GENERATED BY codecgen. +// ************************************************************ + +package certificates + +import ( + "errors" + "fmt" + codec1978 "github.com/ugorji/go/codec" + pkg2_api "k8s.io/kubernetes/pkg/api" + pkg1_unversioned "k8s.io/kubernetes/pkg/api/unversioned" + pkg3_types "k8s.io/kubernetes/pkg/types" + "reflect" + "runtime" + time "time" +) + +const ( + // ----- content types ---- + codecSelferC_UTF81234 = 1 + codecSelferC_RAW1234 = 0 + // ----- value types used ---- + codecSelferValueTypeArray1234 = 10 + codecSelferValueTypeMap1234 = 9 + // ----- containerStateValues ---- + codecSelfer_containerMapKey1234 = 2 + codecSelfer_containerMapValue1234 = 3 + codecSelfer_containerMapEnd1234 = 4 + codecSelfer_containerArrayElem1234 = 6 + codecSelfer_containerArrayEnd1234 = 7 +) + +var ( + codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) + codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) +) + +type codecSelfer1234 struct{} + +func init() { + if codec1978.GenVersion != 5 { + _, file, _, _ := runtime.Caller(0) + err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", + 5, codec1978.GenVersion, file) + panic(err) + } + if false { // reference the types, but skip this branch at build/run time + var v0 pkg2_api.ObjectMeta + var v1 pkg1_unversioned.TypeMeta + var v2 pkg3_types.UID + var v3 time.Time + _, _, _, _ = v0, v1, v2, v3 + } +} + +func (x *CertificateSigningRequest) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [5]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[0] = true + yyq2[1] = true + yyq2[2] = true + yyq2[3] = x.Kind != "" + yyq2[4] = x.APIVersion != "" + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(5) + } else { + yynn2 = 0 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[0] { + yy4 := &x.ObjectMeta + yy4.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy6 := &x.ObjectMeta + yy6.CodecEncodeSelf(e) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + yy9 := &x.Spec + yy9.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy11 := &x.Spec + yy11.CodecEncodeSelf(e) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yy14 := &x.Status + yy14.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy16 := &x.Status + yy16.CodecEncodeSelf(e) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym19 := z.EncBinary() + _ = yym19 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym20 := z.EncBinary() + _ = yym20 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[4] { + yym22 := z.EncBinary() + _ = yym22 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym23 := z.EncBinary() + _ = yym23 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequest) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv4 := &x.ObjectMeta + yyv4.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = CertificateSigningRequestSpec{} + } else { + yyv5 := &x.Spec + yyv5.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = CertificateSigningRequestStatus{} + } else { + yyv6 := &x.Status + yyv6.CodecDecodeSelf(d) + } + case "kind": + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + case "apiVersion": + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj9 int + var yyb9 bool + var yyhl9 bool = l >= 0 + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv10 := &x.ObjectMeta + yyv10.CodecDecodeSelf(d) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = CertificateSigningRequestSpec{} + } else { + yyv11 := &x.Spec + yyv11.CodecDecodeSelf(d) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = CertificateSigningRequestStatus{} + } else { + yyv12 := &x.Status + yyv12.CodecDecodeSelf(d) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj9-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *CertificateSigningRequestSpec) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [4]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[1] = x.Username != "" + yyq2[2] = x.UID != "" + yyq2[3] = len(x.Groups) != 0 + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(4) + } else { + yynn2 = 1 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Request == nil { + r.EncodeNil() + } else { + yym4 := z.EncBinary() + _ = yym4 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Request)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("request")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Request == nil { + r.EncodeNil() + } else { + yym5 := z.EncBinary() + _ = yym5 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Request)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Username)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("username")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Username)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.UID)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("uid")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym11 := z.EncBinary() + _ = yym11 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.UID)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + if x.Groups == nil { + r.EncodeNil() + } else { + yym13 := z.EncBinary() + _ = yym13 + if false { + } else { + z.F.EncSliceStringV(x.Groups, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("groups")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Groups == nil { + r.EncodeNil() + } else { + yym14 := z.EncBinary() + _ = yym14 + if false { + } else { + z.F.EncSliceStringV(x.Groups, false, e) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestSpec) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "request": + if r.TryDecodeAsNil() { + x.Request = nil + } else { + yyv4 := &x.Request + yym5 := z.DecBinary() + _ = yym5 + if false { + } else { + *yyv4 = r.DecodeBytes(*(*[]byte)(yyv4), false, false) + } + } + case "username": + if r.TryDecodeAsNil() { + x.Username = "" + } else { + x.Username = string(r.DecodeString()) + } + case "uid": + if r.TryDecodeAsNil() { + x.UID = "" + } else { + x.UID = string(r.DecodeString()) + } + case "groups": + if r.TryDecodeAsNil() { + x.Groups = nil + } else { + yyv8 := &x.Groups + yym9 := z.DecBinary() + _ = yym9 + if false { + } else { + z.F.DecSliceStringX(yyv8, false, d) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj10 int + var yyb10 bool + var yyhl10 bool = l >= 0 + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Request = nil + } else { + yyv11 := &x.Request + yym12 := z.DecBinary() + _ = yym12 + if false { + } else { + *yyv11 = r.DecodeBytes(*(*[]byte)(yyv11), false, false) + } + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Username = "" + } else { + x.Username = string(r.DecodeString()) + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.UID = "" + } else { + x.UID = string(r.DecodeString()) + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Groups = nil + } else { + yyv15 := &x.Groups + yym16 := z.DecBinary() + _ = yym16 + if false { + } else { + z.F.DecSliceStringX(yyv15, false, d) + } + } + for { + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj10-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *CertificateSigningRequestStatus) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [2]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[0] = len(x.Conditions) != 0 + yyq2[1] = len(x.Certificate) != 0 + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(2) + } else { + yynn2 = 0 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[0] { + if x.Conditions == nil { + r.EncodeNil() + } else { + yym4 := z.EncBinary() + _ = yym4 + if false { + } else { + h.encSliceCertificateSigningRequestCondition(([]CertificateSigningRequestCondition)(x.Conditions), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("conditions")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Conditions == nil { + r.EncodeNil() + } else { + yym5 := z.EncBinary() + _ = yym5 + if false { + } else { + h.encSliceCertificateSigningRequestCondition(([]CertificateSigningRequestCondition)(x.Conditions), e) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + if x.Certificate == nil { + r.EncodeNil() + } else { + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Certificate)) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("certificate")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Certificate == nil { + r.EncodeNil() + } else { + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Certificate)) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestStatus) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "conditions": + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv4 := &x.Conditions + yym5 := z.DecBinary() + _ = yym5 + if false { + } else { + h.decSliceCertificateSigningRequestCondition((*[]CertificateSigningRequestCondition)(yyv4), d) + } + } + case "certificate": + if r.TryDecodeAsNil() { + x.Certificate = nil + } else { + yyv6 := &x.Certificate + yym7 := z.DecBinary() + _ = yym7 + if false { + } else { + *yyv6 = r.DecodeBytes(*(*[]byte)(yyv6), false, false) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj8 int + var yyb8 bool + var yyhl8 bool = l >= 0 + yyj8++ + if yyhl8 { + yyb8 = yyj8 > l + } else { + yyb8 = r.CheckBreak() + } + if yyb8 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv9 := &x.Conditions + yym10 := z.DecBinary() + _ = yym10 + if false { + } else { + h.decSliceCertificateSigningRequestCondition((*[]CertificateSigningRequestCondition)(yyv9), d) + } + } + yyj8++ + if yyhl8 { + yyb8 = yyj8 > l + } else { + yyb8 = r.CheckBreak() + } + if yyb8 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Certificate = nil + } else { + yyv11 := &x.Certificate + yym12 := z.DecBinary() + _ = yym12 + if false { + } else { + *yyv11 = r.DecodeBytes(*(*[]byte)(yyv11), false, false) + } + } + for { + yyj8++ + if yyhl8 { + yyb8 = yyj8 > l + } else { + yyb8 = r.CheckBreak() + } + if yyb8 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj8-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x RequestConditionType) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *RequestConditionType) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *CertificateSigningRequestCondition) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [4]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[1] = x.Reason != "" + yyq2[2] = x.Message != "" + yyq2[3] = true + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(4) + } else { + yynn2 = 1 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + x.Type.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("type")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + x.Type.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("reason")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Message)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("message")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym11 := z.EncBinary() + _ = yym11 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Message)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yy13 := &x.LastUpdateTime + yym14 := z.EncBinary() + _ = yym14 + if false { + } else if z.HasExtensions() && z.EncExt(yy13) { + } else if yym14 { + z.EncBinaryMarshal(yy13) + } else if !yym14 && z.IsJSONHandle() { + z.EncJSONMarshal(yy13) + } else { + z.EncFallback(yy13) + } + } else { + r.EncodeNil() + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("lastUpdateTime")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy15 := &x.LastUpdateTime + yym16 := z.EncBinary() + _ = yym16 + if false { + } else if z.HasExtensions() && z.EncExt(yy15) { + } else if yym16 { + z.EncBinaryMarshal(yy15) + } else if !yym16 && z.IsJSONHandle() { + z.EncJSONMarshal(yy15) + } else { + z.EncFallback(yy15) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestCondition) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RequestConditionType(r.DecodeString()) + } + case "reason": + if r.TryDecodeAsNil() { + x.Reason = "" + } else { + x.Reason = string(r.DecodeString()) + } + case "message": + if r.TryDecodeAsNil() { + x.Message = "" + } else { + x.Message = string(r.DecodeString()) + } + case "lastUpdateTime": + if r.TryDecodeAsNil() { + x.LastUpdateTime = pkg1_unversioned.Time{} + } else { + yyv7 := &x.LastUpdateTime + yym8 := z.DecBinary() + _ = yym8 + if false { + } else if z.HasExtensions() && z.DecExt(yyv7) { + } else if yym8 { + z.DecBinaryUnmarshal(yyv7) + } else if !yym8 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv7) + } else { + z.DecFallback(yyv7, false) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj9 int + var yyb9 bool + var yyhl9 bool = l >= 0 + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RequestConditionType(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Reason = "" + } else { + x.Reason = string(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Message = "" + } else { + x.Message = string(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.LastUpdateTime = pkg1_unversioned.Time{} + } else { + yyv13 := &x.LastUpdateTime + yym14 := z.DecBinary() + _ = yym14 + if false { + } else if z.HasExtensions() && z.DecExt(yyv13) { + } else if yym14 { + z.DecBinaryUnmarshal(yyv13) + } else if !yym14 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv13) + } else { + z.DecFallback(yyv13, false) + } + } + for { + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj9-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *CertificateSigningRequestList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [4]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[0] = true + yyq2[1] = len(x.Items) != 0 + yyq2[2] = x.Kind != "" + yyq2[3] = x.APIVersion != "" + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(4) + } else { + yynn2 = 0 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[0] { + yy4 := &x.ListMeta + yym5 := z.EncBinary() + _ = yym5 + if false { + } else if z.HasExtensions() && z.EncExt(yy4) { + } else { + z.EncFallback(yy4) + } + } else { + r.EncodeNil() + } + } else { + if yyq2[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy6 := &x.ListMeta + yym7 := z.EncBinary() + _ = yym7 + if false { + } else if z.HasExtensions() && z.EncExt(yy6) { + } else { + z.EncFallback(yy6) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + if x.Items == nil { + r.EncodeNil() + } else { + yym9 := z.EncBinary() + _ = yym9 + if false { + } else { + h.encSliceCertificateSigningRequest(([]CertificateSigningRequest)(x.Items), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + h.encSliceCertificateSigningRequest(([]CertificateSigningRequest)(x.Items), e) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym12 := z.EncBinary() + _ = yym12 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym13 := z.EncBinary() + _ = yym13 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym15 := z.EncBinary() + _ = yym15 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym16 := z.EncBinary() + _ = yym16 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv4 := &x.ListMeta + yym5 := z.DecBinary() + _ = yym5 + if false { + } else if z.HasExtensions() && z.DecExt(yyv4) { + } else { + z.DecFallback(yyv4, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv6 := &x.Items + yym7 := z.DecBinary() + _ = yym7 + if false { + } else { + h.decSliceCertificateSigningRequest((*[]CertificateSigningRequest)(yyv6), d) + } + } + case "kind": + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + case "apiVersion": + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj10 int + var yyb10 bool + var yyhl10 bool = l >= 0 + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv11 := &x.ListMeta + yym12 := z.DecBinary() + _ = yym12 + if false { + } else if z.HasExtensions() && z.DecExt(yyv11) { + } else { + z.DecFallback(yyv11, false) + } + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv13 := &x.Items + yym14 := z.DecBinary() + _ = yym14 + if false { + } else { + h.decSliceCertificateSigningRequest((*[]CertificateSigningRequest)(yyv13), d) + } + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj10-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) encSliceCertificateSigningRequestCondition(v []CertificateSigningRequestCondition, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy2 := &yyv1 + yy2.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceCertificateSigningRequestCondition(v *[]CertificateSigningRequestCondition, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := *v + yyh1, yyl1 := z.DecSliceHelperStart() + var yyc1 bool + _ = yyc1 + if yyl1 == 0 { + if yyv1 == nil { + yyv1 = []CertificateSigningRequestCondition{} + yyc1 = true + } else if len(yyv1) != 0 { + yyv1 = yyv1[:0] + yyc1 = true + } + } else if yyl1 > 0 { + var yyrr1, yyrl1 int + var yyrt1 bool + _, _ = yyrl1, yyrt1 + yyrr1 = yyl1 // len(yyv1) + if yyl1 > cap(yyv1) { + + yyrg1 := len(yyv1) > 0 + yyv21 := yyv1 + yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 72) + if yyrt1 { + if yyrl1 <= cap(yyv1) { + yyv1 = yyv1[:yyrl1] + } else { + yyv1 = make([]CertificateSigningRequestCondition, yyrl1) + } + } else { + yyv1 = make([]CertificateSigningRequestCondition, yyrl1) + } + yyc1 = true + yyrr1 = len(yyv1) + if yyrg1 { + copy(yyv1, yyv21) + } + } else if yyl1 != len(yyv1) { + yyv1 = yyv1[:yyl1] + yyc1 = true + } + yyj1 := 0 + for ; yyj1 < yyrr1; yyj1++ { + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequestCondition{} + } else { + yyv2 := &yyv1[yyj1] + yyv2.CodecDecodeSelf(d) + } + + } + if yyrt1 { + for ; yyj1 < yyl1; yyj1++ { + yyv1 = append(yyv1, CertificateSigningRequestCondition{}) + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequestCondition{} + } else { + yyv3 := &yyv1[yyj1] + yyv3.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1 := 0 + for ; !r.CheckBreak(); yyj1++ { + + if yyj1 >= len(yyv1) { + yyv1 = append(yyv1, CertificateSigningRequestCondition{}) // var yyz1 CertificateSigningRequestCondition + yyc1 = true + } + yyh1.ElemContainerState(yyj1) + if yyj1 < len(yyv1) { + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequestCondition{} + } else { + yyv4 := &yyv1[yyj1] + yyv4.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1 < len(yyv1) { + yyv1 = yyv1[:yyj1] + yyc1 = true + } else if yyj1 == 0 && yyv1 == nil { + yyv1 = []CertificateSigningRequestCondition{} + yyc1 = true + } + } + yyh1.End() + if yyc1 { + *v = yyv1 + } +} + +func (x codecSelfer1234) encSliceCertificateSigningRequest(v []CertificateSigningRequest, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy2 := &yyv1 + yy2.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceCertificateSigningRequest(v *[]CertificateSigningRequest, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := *v + yyh1, yyl1 := z.DecSliceHelperStart() + var yyc1 bool + _ = yyc1 + if yyl1 == 0 { + if yyv1 == nil { + yyv1 = []CertificateSigningRequest{} + yyc1 = true + } else if len(yyv1) != 0 { + yyv1 = yyv1[:0] + yyc1 = true + } + } else if yyl1 > 0 { + var yyrr1, yyrl1 int + var yyrt1 bool + _, _ = yyrl1, yyrt1 + yyrr1 = yyl1 // len(yyv1) + if yyl1 > cap(yyv1) { + + yyrg1 := len(yyv1) > 0 + yyv21 := yyv1 + yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368) + if yyrt1 { + if yyrl1 <= cap(yyv1) { + yyv1 = yyv1[:yyrl1] + } else { + yyv1 = make([]CertificateSigningRequest, yyrl1) + } + } else { + yyv1 = make([]CertificateSigningRequest, yyrl1) + } + yyc1 = true + yyrr1 = len(yyv1) + if yyrg1 { + copy(yyv1, yyv21) + } + } else if yyl1 != len(yyv1) { + yyv1 = yyv1[:yyl1] + yyc1 = true + } + yyj1 := 0 + for ; yyj1 < yyrr1; yyj1++ { + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequest{} + } else { + yyv2 := &yyv1[yyj1] + yyv2.CodecDecodeSelf(d) + } + + } + if yyrt1 { + for ; yyj1 < yyl1; yyj1++ { + yyv1 = append(yyv1, CertificateSigningRequest{}) + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequest{} + } else { + yyv3 := &yyv1[yyj1] + yyv3.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1 := 0 + for ; !r.CheckBreak(); yyj1++ { + + if yyj1 >= len(yyv1) { + yyv1 = append(yyv1, CertificateSigningRequest{}) // var yyz1 CertificateSigningRequest + yyc1 = true + } + yyh1.ElemContainerState(yyj1) + if yyj1 < len(yyv1) { + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequest{} + } else { + yyv4 := &yyv1[yyj1] + yyv4.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1 < len(yyv1) { + yyv1 = yyv1[:yyj1] + yyc1 = true + } else if yyj1 == 0 && yyv1 == nil { + yyv1 = []CertificateSigningRequest{} + yyc1 = true + } + } + yyh1.End() + if yyc1 { + *v = yyv1 + } +} diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/types.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/types.go new file mode 100644 index 000000000..c0eb47b1f --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/types.go @@ -0,0 +1,85 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package certificates + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" +) + +// +genclient=true +// +nonNamespaced=true + +// Describes a certificate signing request +type CertificateSigningRequest struct { + unversioned.TypeMeta `json:",inline"` + api.ObjectMeta `json:"metadata,omitempty"` + + // The certificate request itself and any additonal information. + Spec CertificateSigningRequestSpec `json:"spec,omitempty"` + + // Derived information about the request. + Status CertificateSigningRequestStatus `json:"status,omitempty"` +} + +// This information is immutable after the request is created. Only the Request +// and ExtraInfo fields can be set on creation, other fields are derived by +// Kubernetes and cannot be modified by users. +type CertificateSigningRequestSpec struct { + // Base64-encoded PKCS#10 CSR data + Request []byte `json:"request"` + + // Information about the requesting user (if relevant) + // See user.Info interface for details + Username string `json:"username,omitempty"` + UID string `json:"uid,omitempty"` + Groups []string `json:"groups,omitempty"` +} + +type CertificateSigningRequestStatus struct { + // Conditions applied to the request, such as approval or denial. + Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty"` + + // If request was approved, the controller will place the issued certificate here. + Certificate []byte `json:"certificate,omitempty"` +} + +type RequestConditionType string + +// These are the possible conditions for a certificate request. +const ( + CertificateApproved RequestConditionType = "Approved" + CertificateDenied RequestConditionType = "Denied" +) + +type CertificateSigningRequestCondition struct { + // request approval state, currently Approved or Denied. + Type RequestConditionType `json:"type"` + // brief reason for the request state + Reason string `json:"reason,omitempty"` + // human readable message with details about the request state + Message string `json:"message,omitempty"` + // timestamp for the last update to this condition + LastUpdateTime unversioned.Time `json:"lastUpdateTime,omitempty"` +} + +type CertificateSigningRequestList struct { + unversioned.TypeMeta `json:",inline"` + unversioned.ListMeta `json:"metadata,omitempty"` + + Items []CertificateSigningRequest `json:"items,omitempty"` +} diff --git a/vendor/k8s.io/kubernetes/pkg/api/resource/deep_copy.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/conversion.go similarity index 60% rename from vendor/k8s.io/kubernetes/pkg/api/resource/deep_copy.go rename to vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/conversion.go index 4efc0406f..0b933b259 100644 --- a/vendor/k8s.io/kubernetes/pkg/api/resource/deep_copy.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,19 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -package resource +package v1alpha1 -import ( - inf "gopkg.in/inf.v0" +import "k8s.io/kubernetes/pkg/runtime" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func DeepCopy_resource_Quantity(in Quantity, out *Quantity, c *conversion.Cloner) error { - *out = in - if in.d.Dec != nil { - tmp := &inf.Dec{} - out.d.Dec = tmp.Set(in.d.Dec) - } - return nil +func addConversionFuncs(scheme *runtime.Scheme) { + // Add non-generated conversion functions here. Currently there are none. } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/conversion_generated.go new file mode 100644 index 000000000..454a98bf3 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/conversion_generated.go @@ -0,0 +1,237 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by conversion-gen. Do not edit it manually! + +package v1alpha1 + +import ( + api "k8s.io/kubernetes/pkg/api" + certificates "k8s.io/kubernetes/pkg/apis/certificates" + conversion "k8s.io/kubernetes/pkg/conversion" +) + +func init() { + if err := api.Scheme.AddGeneratedConversionFuncs( + Convert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest, + Convert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest, + Convert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition, + Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition, + Convert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList, + Convert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList, + Convert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec, + Convert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec, + Convert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus, + Convert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus, + ); err != nil { + // if one of the conversion functions is malformed, detect it immediately. + panic(err) + } +} + +func autoConvert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(in *CertificateSigningRequest, out *certificates.CertificateSigningRequest, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(in *CertificateSigningRequest, out *certificates.CertificateSigningRequest, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(in, out, s) +} + +func autoConvert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(in *certificates.CertificateSigningRequest, out *CertificateSigningRequest, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(in *certificates.CertificateSigningRequest, out *CertificateSigningRequest, s conversion.Scope) error { + return autoConvert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(in, out, s) +} + +func autoConvert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(in *CertificateSigningRequestCondition, out *certificates.CertificateSigningRequestCondition, s conversion.Scope) error { + out.Type = certificates.RequestConditionType(in.Type) + out.Reason = in.Reason + out.Message = in.Message + if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastUpdateTime, &out.LastUpdateTime, s); err != nil { + return err + } + return nil +} + +func Convert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(in *CertificateSigningRequestCondition, out *certificates.CertificateSigningRequestCondition, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(in, out, s) +} + +func autoConvert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(in *certificates.CertificateSigningRequestCondition, out *CertificateSigningRequestCondition, s conversion.Scope) error { + out.Type = RequestConditionType(in.Type) + out.Reason = in.Reason + out.Message = in.Message + if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastUpdateTime, &out.LastUpdateTime, s); err != nil { + return err + } + return nil +} + +func Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(in *certificates.CertificateSigningRequestCondition, out *CertificateSigningRequestCondition, s conversion.Scope) error { + return autoConvert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(in, out, s) +} + +func autoConvert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList(in *CertificateSigningRequestList, out *certificates.CertificateSigningRequestList, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil { + return err + } + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]certificates.CertificateSigningRequest, len(*in)) + for i := range *in { + if err := Convert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList(in *CertificateSigningRequestList, out *certificates.CertificateSigningRequestList, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList(in, out, s) +} + +func autoConvert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList(in *certificates.CertificateSigningRequestList, out *CertificateSigningRequestList, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil { + return err + } + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CertificateSigningRequest, len(*in)) + for i := range *in { + if err := Convert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList(in *certificates.CertificateSigningRequestList, out *CertificateSigningRequestList, s conversion.Scope) error { + return autoConvert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList(in, out, s) +} + +func autoConvert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(in *CertificateSigningRequestSpec, out *certificates.CertificateSigningRequestSpec, s conversion.Scope) error { + if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Request, &out.Request, s); err != nil { + return err + } + out.Username = in.Username + out.UID = in.UID + out.Groups = in.Groups + return nil +} + +func Convert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(in *CertificateSigningRequestSpec, out *certificates.CertificateSigningRequestSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(in, out, s) +} + +func autoConvert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(in *certificates.CertificateSigningRequestSpec, out *CertificateSigningRequestSpec, s conversion.Scope) error { + if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Request, &out.Request, s); err != nil { + return err + } + out.Username = in.Username + out.UID = in.UID + out.Groups = in.Groups + return nil +} + +func Convert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(in *certificates.CertificateSigningRequestSpec, out *CertificateSigningRequestSpec, s conversion.Scope) error { + return autoConvert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(in, out, s) +} + +func autoConvert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(in *CertificateSigningRequestStatus, out *certificates.CertificateSigningRequestStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]certificates.CertificateSigningRequestCondition, len(*in)) + for i := range *in { + if err := Convert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Certificate, &out.Certificate, s); err != nil { + return err + } + return nil +} + +func Convert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(in *CertificateSigningRequestStatus, out *certificates.CertificateSigningRequestStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(in, out, s) +} + +func autoConvert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(in *certificates.CertificateSigningRequestStatus, out *CertificateSigningRequestStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]CertificateSigningRequestCondition, len(*in)) + for i := range *in { + if err := Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Certificate, &out.Certificate, s); err != nil { + return err + } + return nil +} + +func Convert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(in *certificates.CertificateSigningRequestStatus, out *CertificateSigningRequestStatus, s conversion.Scope) error { + return autoConvert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(in, out, s) +} diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/deep_copy_generated.go new file mode 100644 index 000000000..5b4a3ad22 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/deep_copy_generated.go @@ -0,0 +1,121 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by deepcopy-gen. Do not edit it manually! + +package v1alpha1 + +import ( + api "k8s.io/kubernetes/pkg/api" + v1 "k8s.io/kubernetes/pkg/api/v1" + conversion "k8s.io/kubernetes/pkg/conversion" +) + +func init() { + if err := api.Scheme.AddGeneratedDeepCopyFuncs( + DeepCopy_v1alpha1_CertificateSigningRequest, + DeepCopy_v1alpha1_CertificateSigningRequestCondition, + DeepCopy_v1alpha1_CertificateSigningRequestList, + DeepCopy_v1alpha1_CertificateSigningRequestSpec, + DeepCopy_v1alpha1_CertificateSigningRequestStatus, + ); err != nil { + // if one of the deep copy functions is malformed, detect it immediately. + panic(err) + } +} + +func DeepCopy_v1alpha1_CertificateSigningRequest(in CertificateSigningRequest, out *CertificateSigningRequest, c *conversion.Cloner) error { + out.TypeMeta = in.TypeMeta + if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + return err + } + if err := DeepCopy_v1alpha1_CertificateSigningRequestSpec(in.Spec, &out.Spec, c); err != nil { + return err + } + if err := DeepCopy_v1alpha1_CertificateSigningRequestStatus(in.Status, &out.Status, c); err != nil { + return err + } + return nil +} + +func DeepCopy_v1alpha1_CertificateSigningRequestCondition(in CertificateSigningRequestCondition, out *CertificateSigningRequestCondition, c *conversion.Cloner) error { + out.Type = in.Type + out.Reason = in.Reason + out.Message = in.Message + out.LastUpdateTime = in.LastUpdateTime.DeepCopy() + return nil +} + +func DeepCopy_v1alpha1_CertificateSigningRequestList(in CertificateSigningRequestList, out *CertificateSigningRequestList, c *conversion.Cloner) error { + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := in.Items, &out.Items + *out = make([]CertificateSigningRequest, len(in)) + for i := range in { + if err := DeepCopy_v1alpha1_CertificateSigningRequest(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func DeepCopy_v1alpha1_CertificateSigningRequestSpec(in CertificateSigningRequestSpec, out *CertificateSigningRequestSpec, c *conversion.Cloner) error { + if in.Request != nil { + in, out := in.Request, &out.Request + *out = make([]byte, len(in)) + copy(*out, in) + } else { + out.Request = nil + } + out.Username = in.Username + out.UID = in.UID + if in.Groups != nil { + in, out := in.Groups, &out.Groups + *out = make([]string, len(in)) + copy(*out, in) + } else { + out.Groups = nil + } + return nil +} + +func DeepCopy_v1alpha1_CertificateSigningRequestStatus(in CertificateSigningRequestStatus, out *CertificateSigningRequestStatus, c *conversion.Cloner) error { + if in.Conditions != nil { + in, out := in.Conditions, &out.Conditions + *out = make([]CertificateSigningRequestCondition, len(in)) + for i := range in { + if err := DeepCopy_v1alpha1_CertificateSigningRequestCondition(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if in.Certificate != nil { + in, out := in.Certificate, &out.Certificate + *out = make([]byte, len(in)) + copy(*out, in) + } else { + out.Certificate = nil + } + return nil +} diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/doc.go new file mode 100644 index 000000000..3528c164f --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/certificates + +package v1alpha1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.pb.go new file mode 100644 index 000000000..174d7ef0c --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.pb.go @@ -0,0 +1,1192 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. +// source: k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.proto +// DO NOT EDIT! + +/* + Package v1alpha1 is a generated protocol buffer package. + + It is generated from these files: + k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.proto + + It has these top-level messages: + CertificateSigningRequest + CertificateSigningRequestCondition + CertificateSigningRequestList + CertificateSigningRequestSpec + CertificateSigningRequestStatus +*/ +package v1alpha1 + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func (m *CertificateSigningRequest) Reset() { *m = CertificateSigningRequest{} } +func (m *CertificateSigningRequest) String() string { return proto.CompactTextString(m) } +func (*CertificateSigningRequest) ProtoMessage() {} + +func (m *CertificateSigningRequestCondition) Reset() { *m = CertificateSigningRequestCondition{} } +func (m *CertificateSigningRequestCondition) String() string { return proto.CompactTextString(m) } +func (*CertificateSigningRequestCondition) ProtoMessage() {} + +func (m *CertificateSigningRequestList) Reset() { *m = CertificateSigningRequestList{} } +func (m *CertificateSigningRequestList) String() string { return proto.CompactTextString(m) } +func (*CertificateSigningRequestList) ProtoMessage() {} + +func (m *CertificateSigningRequestSpec) Reset() { *m = CertificateSigningRequestSpec{} } +func (m *CertificateSigningRequestSpec) String() string { return proto.CompactTextString(m) } +func (*CertificateSigningRequestSpec) ProtoMessage() {} + +func (m *CertificateSigningRequestStatus) Reset() { *m = CertificateSigningRequestStatus{} } +func (m *CertificateSigningRequestStatus) String() string { return proto.CompactTextString(m) } +func (*CertificateSigningRequestStatus) ProtoMessage() {} + +func init() { + proto.RegisterType((*CertificateSigningRequest)(nil), "k8s.io.kubernetes.pkg.apis.certificates.v1alpha1.CertificateSigningRequest") + proto.RegisterType((*CertificateSigningRequestCondition)(nil), "k8s.io.kubernetes.pkg.apis.certificates.v1alpha1.CertificateSigningRequestCondition") + proto.RegisterType((*CertificateSigningRequestList)(nil), "k8s.io.kubernetes.pkg.apis.certificates.v1alpha1.CertificateSigningRequestList") + proto.RegisterType((*CertificateSigningRequestSpec)(nil), "k8s.io.kubernetes.pkg.apis.certificates.v1alpha1.CertificateSigningRequestSpec") + proto.RegisterType((*CertificateSigningRequestStatus)(nil), "k8s.io.kubernetes.pkg.apis.certificates.v1alpha1.CertificateSigningRequestStatus") +} +func (m *CertificateSigningRequest) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CertificateSigningRequest) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(m.ObjectMeta.Size())) + n1, err := m.ObjectMeta.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n1 + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(m.Spec.Size())) + n2, err := m.Spec.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n2 + data[i] = 0x1a + i++ + i = encodeVarintGenerated(data, i, uint64(m.Status.Size())) + n3, err := m.Status.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n3 + return i, nil +} + +func (m *CertificateSigningRequestCondition) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CertificateSigningRequestCondition) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.Type))) + i += copy(data[i:], m.Type) + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.Reason))) + i += copy(data[i:], m.Reason) + data[i] = 0x1a + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.Message))) + i += copy(data[i:], m.Message) + data[i] = 0x22 + i++ + i = encodeVarintGenerated(data, i, uint64(m.LastUpdateTime.Size())) + n4, err := m.LastUpdateTime.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n4 + return i, nil +} + +func (m *CertificateSigningRequestList) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CertificateSigningRequestList) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(m.ListMeta.Size())) + n5, err := m.ListMeta.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n5 + if len(m.Items) > 0 { + for _, msg := range m.Items { + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *CertificateSigningRequestSpec) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CertificateSigningRequestSpec) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Request != nil { + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.Request))) + i += copy(data[i:], m.Request) + } + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.Username))) + i += copy(data[i:], m.Username) + data[i] = 0x1a + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.UID))) + i += copy(data[i:], m.UID) + if len(m.Groups) > 0 { + for _, s := range m.Groups { + data[i] = 0x22 + i++ + l = len(s) + for l >= 1<<7 { + data[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + data[i] = uint8(l) + i++ + i += copy(data[i:], s) + } + } + return i, nil +} + +func (m *CertificateSigningRequestStatus) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CertificateSigningRequestStatus) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for _, msg := range m.Conditions { + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.Certificate != nil { + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.Certificate))) + i += copy(data[i:], m.Certificate) + } + return i, nil +} + +func encodeFixed64Generated(data []byte, offset int, v uint64) int { + data[offset] = uint8(v) + data[offset+1] = uint8(v >> 8) + data[offset+2] = uint8(v >> 16) + data[offset+3] = uint8(v >> 24) + data[offset+4] = uint8(v >> 32) + data[offset+5] = uint8(v >> 40) + data[offset+6] = uint8(v >> 48) + data[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32Generated(data []byte, offset int, v uint32) int { + data[offset] = uint8(v) + data[offset+1] = uint8(v >> 8) + data[offset+2] = uint8(v >> 16) + data[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintGenerated(data []byte, offset int, v uint64) int { + for v >= 1<<7 { + data[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + data[offset] = uint8(v) + return offset + 1 +} +func (m *CertificateSigningRequest) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CertificateSigningRequestCondition) Size() (n int) { + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + l = m.LastUpdateTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CertificateSigningRequestList) Size() (n int) { + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CertificateSigningRequestSpec) Size() (n int) { + var l int + _ = l + if m.Request != nil { + l = len(m.Request) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.UID) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Groups) > 0 { + for _, s := range m.Groups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CertificateSigningRequestStatus) Size() (n int) { + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Certificate != nil { + l = len(m.Certificate) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func sovGenerated(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CertificateSigningRequest) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestCondition) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = RequestConditionType(data[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(data[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(data[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdateTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastUpdateTime.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestList) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, CertificateSigningRequest{}) + if err := m.Items[len(m.Items)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestSpec) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = append(m.Request[:0], data[iNdEx:postIndex]...) + if m.Request == nil { + m.Request = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(data[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UID = string(data[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestStatus) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, CertificateSigningRequestCondition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Certificate = append(m.Certificate[:0], data[iNdEx:postIndex]...) + if m.Certificate == nil { + m.Certificate = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(data []byte) (n int, err error) { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if data[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipGenerated(data[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.proto new file mode 100644 index 000000000..450b374a1 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/generated.proto @@ -0,0 +1,86 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = 'proto2'; + +package k8s.io.kubernetes.pkg.apis.certificates.v1alpha1; + +import "k8s.io/kubernetes/pkg/api/resource/generated.proto"; +import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto"; +import "k8s.io/kubernetes/pkg/api/v1/generated.proto"; +import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; + +// Package-wide variables from generator "generated". +option go_package = "v1alpha1"; + +// Describes a certificate signing request +message CertificateSigningRequest { + optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; + + // The certificate request itself and any additonal information. + optional CertificateSigningRequestSpec spec = 2; + + // Derived information about the request. + optional CertificateSigningRequestStatus status = 3; +} + +message CertificateSigningRequestCondition { + // request approval state, currently Approved or Denied. + optional string type = 1; + + // brief reason for the request state + optional string reason = 2; + + // human readable message with details about the request state + optional string message = 3; + + // timestamp for the last update to this condition + optional k8s.io.kubernetes.pkg.api.unversioned.Time lastUpdateTime = 4; +} + +message CertificateSigningRequestList { + optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1; + + repeated CertificateSigningRequest items = 2; +} + +// This information is immutable after the request is created. Only the Request +// and ExtraInfo fields can be set on creation, other fields are derived by +// Kubernetes and cannot be modified by users. +message CertificateSigningRequestSpec { + // Base64-encoded PKCS#10 CSR data + optional bytes request = 1; + + // Information about the requesting user (if relevant) + // See user.Info interface for details + optional string username = 2; + + optional string uid = 3; + + repeated string groups = 4; +} + +message CertificateSigningRequestStatus { + // Conditions applied to the request, such as approval or denial. + repeated CertificateSigningRequestCondition conditions = 1; + + // If request was approved, the controller will place the issued certificate here. + optional bytes certificate = 2; +} + diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/register.go new file mode 100644 index 000000000..7b841c0b5 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/register.go @@ -0,0 +1,62 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api/v1" + "k8s.io/kubernetes/pkg/runtime" + versionedwatch "k8s.io/kubernetes/pkg/watch/versioned" +) + +// GroupName is the group name use in this package +const GroupName = "certificates" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) unversioned.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns back a Group qualified GroupResource +func Resource(resource string) unversioned.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +func AddToScheme(scheme *runtime.Scheme) { + addKnownTypes(scheme) + // addDefaultingFuncs(scheme) + addConversionFuncs(scheme) +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) { + scheme.AddKnownTypes(SchemeGroupVersion, + &CertificateSigningRequest{}, + &CertificateSigningRequestList{}, + &v1.ListOptions{}, + &v1.DeleteOptions{}, + ) + + // Add the watch version that applies + versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) +} + +func (obj *CertificateSigningRequest) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *CertificateSigningRequestList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types.generated.go new file mode 100644 index 000000000..74d67657f --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types.generated.go @@ -0,0 +1,1963 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// ************************************************************ +// DO NOT EDIT. +// THIS FILE IS AUTO-GENERATED BY codecgen. +// ************************************************************ + +package v1alpha1 + +import ( + "errors" + "fmt" + codec1978 "github.com/ugorji/go/codec" + pkg1_unversioned "k8s.io/kubernetes/pkg/api/unversioned" + pkg2_v1 "k8s.io/kubernetes/pkg/api/v1" + pkg3_types "k8s.io/kubernetes/pkg/types" + "reflect" + "runtime" + time "time" +) + +const ( + // ----- content types ---- + codecSelferC_UTF81234 = 1 + codecSelferC_RAW1234 = 0 + // ----- value types used ---- + codecSelferValueTypeArray1234 = 10 + codecSelferValueTypeMap1234 = 9 + // ----- containerStateValues ---- + codecSelfer_containerMapKey1234 = 2 + codecSelfer_containerMapValue1234 = 3 + codecSelfer_containerMapEnd1234 = 4 + codecSelfer_containerArrayElem1234 = 6 + codecSelfer_containerArrayEnd1234 = 7 +) + +var ( + codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) + codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) +) + +type codecSelfer1234 struct{} + +func init() { + if codec1978.GenVersion != 5 { + _, file, _, _ := runtime.Caller(0) + err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", + 5, codec1978.GenVersion, file) + panic(err) + } + if false { // reference the types, but skip this branch at build/run time + var v0 pkg1_unversioned.TypeMeta + var v1 pkg2_v1.ObjectMeta + var v2 pkg3_types.UID + var v3 time.Time + _, _, _, _ = v0, v1, v2, v3 + } +} + +func (x *CertificateSigningRequest) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [5]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[0] = true + yyq2[1] = true + yyq2[2] = true + yyq2[3] = x.Kind != "" + yyq2[4] = x.APIVersion != "" + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(5) + } else { + yynn2 = 0 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[0] { + yy4 := &x.ObjectMeta + yy4.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy6 := &x.ObjectMeta + yy6.CodecEncodeSelf(e) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + yy9 := &x.Spec + yy9.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy11 := &x.Spec + yy11.CodecEncodeSelf(e) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yy14 := &x.Status + yy14.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy16 := &x.Status + yy16.CodecEncodeSelf(e) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym19 := z.EncBinary() + _ = yym19 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym20 := z.EncBinary() + _ = yym20 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[4] { + yym22 := z.EncBinary() + _ = yym22 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym23 := z.EncBinary() + _ = yym23 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequest) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv4 := &x.ObjectMeta + yyv4.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = CertificateSigningRequestSpec{} + } else { + yyv5 := &x.Spec + yyv5.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = CertificateSigningRequestStatus{} + } else { + yyv6 := &x.Status + yyv6.CodecDecodeSelf(d) + } + case "kind": + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + case "apiVersion": + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj9 int + var yyb9 bool + var yyhl9 bool = l >= 0 + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv10 := &x.ObjectMeta + yyv10.CodecDecodeSelf(d) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = CertificateSigningRequestSpec{} + } else { + yyv11 := &x.Spec + yyv11.CodecDecodeSelf(d) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = CertificateSigningRequestStatus{} + } else { + yyv12 := &x.Status + yyv12.CodecDecodeSelf(d) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj9-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *CertificateSigningRequestSpec) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [4]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[1] = x.Username != "" + yyq2[2] = x.UID != "" + yyq2[3] = len(x.Groups) != 0 + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(4) + } else { + yynn2 = 1 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Request == nil { + r.EncodeNil() + } else { + yym4 := z.EncBinary() + _ = yym4 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Request)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("request")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Request == nil { + r.EncodeNil() + } else { + yym5 := z.EncBinary() + _ = yym5 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Request)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Username)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("username")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Username)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.UID)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("uid")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym11 := z.EncBinary() + _ = yym11 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.UID)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + if x.Groups == nil { + r.EncodeNil() + } else { + yym13 := z.EncBinary() + _ = yym13 + if false { + } else { + z.F.EncSliceStringV(x.Groups, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("groups")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Groups == nil { + r.EncodeNil() + } else { + yym14 := z.EncBinary() + _ = yym14 + if false { + } else { + z.F.EncSliceStringV(x.Groups, false, e) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestSpec) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "request": + if r.TryDecodeAsNil() { + x.Request = nil + } else { + yyv4 := &x.Request + yym5 := z.DecBinary() + _ = yym5 + if false { + } else { + *yyv4 = r.DecodeBytes(*(*[]byte)(yyv4), false, false) + } + } + case "username": + if r.TryDecodeAsNil() { + x.Username = "" + } else { + x.Username = string(r.DecodeString()) + } + case "uid": + if r.TryDecodeAsNil() { + x.UID = "" + } else { + x.UID = string(r.DecodeString()) + } + case "groups": + if r.TryDecodeAsNil() { + x.Groups = nil + } else { + yyv8 := &x.Groups + yym9 := z.DecBinary() + _ = yym9 + if false { + } else { + z.F.DecSliceStringX(yyv8, false, d) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj10 int + var yyb10 bool + var yyhl10 bool = l >= 0 + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Request = nil + } else { + yyv11 := &x.Request + yym12 := z.DecBinary() + _ = yym12 + if false { + } else { + *yyv11 = r.DecodeBytes(*(*[]byte)(yyv11), false, false) + } + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Username = "" + } else { + x.Username = string(r.DecodeString()) + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.UID = "" + } else { + x.UID = string(r.DecodeString()) + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Groups = nil + } else { + yyv15 := &x.Groups + yym16 := z.DecBinary() + _ = yym16 + if false { + } else { + z.F.DecSliceStringX(yyv15, false, d) + } + } + for { + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj10-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *CertificateSigningRequestStatus) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [2]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[0] = len(x.Conditions) != 0 + yyq2[1] = len(x.Certificate) != 0 + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(2) + } else { + yynn2 = 0 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[0] { + if x.Conditions == nil { + r.EncodeNil() + } else { + yym4 := z.EncBinary() + _ = yym4 + if false { + } else { + h.encSliceCertificateSigningRequestCondition(([]CertificateSigningRequestCondition)(x.Conditions), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("conditions")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Conditions == nil { + r.EncodeNil() + } else { + yym5 := z.EncBinary() + _ = yym5 + if false { + } else { + h.encSliceCertificateSigningRequestCondition(([]CertificateSigningRequestCondition)(x.Conditions), e) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + if x.Certificate == nil { + r.EncodeNil() + } else { + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Certificate)) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("certificate")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Certificate == nil { + r.EncodeNil() + } else { + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Certificate)) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestStatus) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "conditions": + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv4 := &x.Conditions + yym5 := z.DecBinary() + _ = yym5 + if false { + } else { + h.decSliceCertificateSigningRequestCondition((*[]CertificateSigningRequestCondition)(yyv4), d) + } + } + case "certificate": + if r.TryDecodeAsNil() { + x.Certificate = nil + } else { + yyv6 := &x.Certificate + yym7 := z.DecBinary() + _ = yym7 + if false { + } else { + *yyv6 = r.DecodeBytes(*(*[]byte)(yyv6), false, false) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj8 int + var yyb8 bool + var yyhl8 bool = l >= 0 + yyj8++ + if yyhl8 { + yyb8 = yyj8 > l + } else { + yyb8 = r.CheckBreak() + } + if yyb8 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv9 := &x.Conditions + yym10 := z.DecBinary() + _ = yym10 + if false { + } else { + h.decSliceCertificateSigningRequestCondition((*[]CertificateSigningRequestCondition)(yyv9), d) + } + } + yyj8++ + if yyhl8 { + yyb8 = yyj8 > l + } else { + yyb8 = r.CheckBreak() + } + if yyb8 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Certificate = nil + } else { + yyv11 := &x.Certificate + yym12 := z.DecBinary() + _ = yym12 + if false { + } else { + *yyv11 = r.DecodeBytes(*(*[]byte)(yyv11), false, false) + } + } + for { + yyj8++ + if yyhl8 { + yyb8 = yyj8 > l + } else { + yyb8 = r.CheckBreak() + } + if yyb8 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj8-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x RequestConditionType) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *RequestConditionType) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *CertificateSigningRequestCondition) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [4]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[1] = x.Reason != "" + yyq2[2] = x.Message != "" + yyq2[3] = true + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(4) + } else { + yynn2 = 1 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + x.Type.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("type")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + x.Type.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("reason")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Message)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("message")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym11 := z.EncBinary() + _ = yym11 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Message)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yy13 := &x.LastUpdateTime + yym14 := z.EncBinary() + _ = yym14 + if false { + } else if z.HasExtensions() && z.EncExt(yy13) { + } else if yym14 { + z.EncBinaryMarshal(yy13) + } else if !yym14 && z.IsJSONHandle() { + z.EncJSONMarshal(yy13) + } else { + z.EncFallback(yy13) + } + } else { + r.EncodeNil() + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("lastUpdateTime")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy15 := &x.LastUpdateTime + yym16 := z.EncBinary() + _ = yym16 + if false { + } else if z.HasExtensions() && z.EncExt(yy15) { + } else if yym16 { + z.EncBinaryMarshal(yy15) + } else if !yym16 && z.IsJSONHandle() { + z.EncJSONMarshal(yy15) + } else { + z.EncFallback(yy15) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestCondition) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RequestConditionType(r.DecodeString()) + } + case "reason": + if r.TryDecodeAsNil() { + x.Reason = "" + } else { + x.Reason = string(r.DecodeString()) + } + case "message": + if r.TryDecodeAsNil() { + x.Message = "" + } else { + x.Message = string(r.DecodeString()) + } + case "lastUpdateTime": + if r.TryDecodeAsNil() { + x.LastUpdateTime = pkg1_unversioned.Time{} + } else { + yyv7 := &x.LastUpdateTime + yym8 := z.DecBinary() + _ = yym8 + if false { + } else if z.HasExtensions() && z.DecExt(yyv7) { + } else if yym8 { + z.DecBinaryUnmarshal(yyv7) + } else if !yym8 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv7) + } else { + z.DecFallback(yyv7, false) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj9 int + var yyb9 bool + var yyhl9 bool = l >= 0 + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RequestConditionType(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Reason = "" + } else { + x.Reason = string(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Message = "" + } else { + x.Message = string(r.DecodeString()) + } + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.LastUpdateTime = pkg1_unversioned.Time{} + } else { + yyv13 := &x.LastUpdateTime + yym14 := z.DecBinary() + _ = yym14 + if false { + } else if z.HasExtensions() && z.DecExt(yyv13) { + } else if yym14 { + z.DecBinaryUnmarshal(yyv13) + } else if !yym14 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv13) + } else { + z.DecFallback(yyv13, false) + } + } + for { + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = r.CheckBreak() + } + if yyb9 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj9-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *CertificateSigningRequestList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + var yyq2 [4]bool + _, _, _ = yysep2, yyq2, yy2arr2 + const yyr2 bool = false + yyq2[0] = true + yyq2[1] = len(x.Items) != 0 + yyq2[2] = x.Kind != "" + yyq2[3] = x.APIVersion != "" + var yynn2 int + if yyr2 || yy2arr2 { + r.EncodeArrayStart(4) + } else { + yynn2 = 0 + for _, b := range yyq2 { + if b { + yynn2++ + } + } + r.EncodeMapStart(yynn2) + yynn2 = 0 + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[0] { + yy4 := &x.ListMeta + yym5 := z.EncBinary() + _ = yym5 + if false { + } else if z.HasExtensions() && z.EncExt(yy4) { + } else { + z.EncFallback(yy4) + } + } else { + r.EncodeNil() + } + } else { + if yyq2[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy6 := &x.ListMeta + yym7 := z.EncBinary() + _ = yym7 + if false { + } else if z.HasExtensions() && z.EncExt(yy6) { + } else { + z.EncFallback(yy6) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[1] { + if x.Items == nil { + r.EncodeNil() + } else { + yym9 := z.EncBinary() + _ = yym9 + if false { + } else { + h.encSliceCertificateSigningRequest(([]CertificateSigningRequest)(x.Items), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + h.encSliceCertificateSigningRequest(([]CertificateSigningRequest)(x.Items), e) + } + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym12 := z.EncBinary() + _ = yym12 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym13 := z.EncBinary() + _ = yym13 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym15 := z.EncBinary() + _ = yym15 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym16 := z.EncBinary() + _ = yym16 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *CertificateSigningRequestList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap1234 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray1234 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *CertificateSigningRequestList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3Slc = r.DecodeBytes(yys3Slc, true, true) + yys3 := string(yys3Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv4 := &x.ListMeta + yym5 := z.DecBinary() + _ = yym5 + if false { + } else if z.HasExtensions() && z.DecExt(yyv4) { + } else { + z.DecFallback(yyv4, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv6 := &x.Items + yym7 := z.DecBinary() + _ = yym7 + if false { + } else { + h.decSliceCertificateSigningRequest((*[]CertificateSigningRequest)(yyv6), d) + } + } + case "kind": + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + case "apiVersion": + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *CertificateSigningRequestList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj10 int + var yyb10 bool + var yyhl10 bool = l >= 0 + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv11 := &x.ListMeta + yym12 := z.DecBinary() + _ = yym12 + if false { + } else if z.HasExtensions() && z.DecExt(yyv11) { + } else { + z.DecFallback(yyv11, false) + } + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv13 := &x.Items + yym14 := z.DecBinary() + _ = yym14 + if false { + } else { + h.decSliceCertificateSigningRequest((*[]CertificateSigningRequest)(yyv13), d) + } + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = r.CheckBreak() + } + if yyb10 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj10-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) encSliceCertificateSigningRequestCondition(v []CertificateSigningRequestCondition, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy2 := &yyv1 + yy2.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceCertificateSigningRequestCondition(v *[]CertificateSigningRequestCondition, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := *v + yyh1, yyl1 := z.DecSliceHelperStart() + var yyc1 bool + _ = yyc1 + if yyl1 == 0 { + if yyv1 == nil { + yyv1 = []CertificateSigningRequestCondition{} + yyc1 = true + } else if len(yyv1) != 0 { + yyv1 = yyv1[:0] + yyc1 = true + } + } else if yyl1 > 0 { + var yyrr1, yyrl1 int + var yyrt1 bool + _, _ = yyrl1, yyrt1 + yyrr1 = yyl1 // len(yyv1) + if yyl1 > cap(yyv1) { + + yyrg1 := len(yyv1) > 0 + yyv21 := yyv1 + yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 72) + if yyrt1 { + if yyrl1 <= cap(yyv1) { + yyv1 = yyv1[:yyrl1] + } else { + yyv1 = make([]CertificateSigningRequestCondition, yyrl1) + } + } else { + yyv1 = make([]CertificateSigningRequestCondition, yyrl1) + } + yyc1 = true + yyrr1 = len(yyv1) + if yyrg1 { + copy(yyv1, yyv21) + } + } else if yyl1 != len(yyv1) { + yyv1 = yyv1[:yyl1] + yyc1 = true + } + yyj1 := 0 + for ; yyj1 < yyrr1; yyj1++ { + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequestCondition{} + } else { + yyv2 := &yyv1[yyj1] + yyv2.CodecDecodeSelf(d) + } + + } + if yyrt1 { + for ; yyj1 < yyl1; yyj1++ { + yyv1 = append(yyv1, CertificateSigningRequestCondition{}) + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequestCondition{} + } else { + yyv3 := &yyv1[yyj1] + yyv3.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1 := 0 + for ; !r.CheckBreak(); yyj1++ { + + if yyj1 >= len(yyv1) { + yyv1 = append(yyv1, CertificateSigningRequestCondition{}) // var yyz1 CertificateSigningRequestCondition + yyc1 = true + } + yyh1.ElemContainerState(yyj1) + if yyj1 < len(yyv1) { + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequestCondition{} + } else { + yyv4 := &yyv1[yyj1] + yyv4.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1 < len(yyv1) { + yyv1 = yyv1[:yyj1] + yyc1 = true + } else if yyj1 == 0 && yyv1 == nil { + yyv1 = []CertificateSigningRequestCondition{} + yyc1 = true + } + } + yyh1.End() + if yyc1 { + *v = yyv1 + } +} + +func (x codecSelfer1234) encSliceCertificateSigningRequest(v []CertificateSigningRequest, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy2 := &yyv1 + yy2.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceCertificateSigningRequest(v *[]CertificateSigningRequest, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := *v + yyh1, yyl1 := z.DecSliceHelperStart() + var yyc1 bool + _ = yyc1 + if yyl1 == 0 { + if yyv1 == nil { + yyv1 = []CertificateSigningRequest{} + yyc1 = true + } else if len(yyv1) != 0 { + yyv1 = yyv1[:0] + yyc1 = true + } + } else if yyl1 > 0 { + var yyrr1, yyrl1 int + var yyrt1 bool + _, _ = yyrl1, yyrt1 + yyrr1 = yyl1 // len(yyv1) + if yyl1 > cap(yyv1) { + + yyrg1 := len(yyv1) > 0 + yyv21 := yyv1 + yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368) + if yyrt1 { + if yyrl1 <= cap(yyv1) { + yyv1 = yyv1[:yyrl1] + } else { + yyv1 = make([]CertificateSigningRequest, yyrl1) + } + } else { + yyv1 = make([]CertificateSigningRequest, yyrl1) + } + yyc1 = true + yyrr1 = len(yyv1) + if yyrg1 { + copy(yyv1, yyv21) + } + } else if yyl1 != len(yyv1) { + yyv1 = yyv1[:yyl1] + yyc1 = true + } + yyj1 := 0 + for ; yyj1 < yyrr1; yyj1++ { + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequest{} + } else { + yyv2 := &yyv1[yyj1] + yyv2.CodecDecodeSelf(d) + } + + } + if yyrt1 { + for ; yyj1 < yyl1; yyj1++ { + yyv1 = append(yyv1, CertificateSigningRequest{}) + yyh1.ElemContainerState(yyj1) + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequest{} + } else { + yyv3 := &yyv1[yyj1] + yyv3.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1 := 0 + for ; !r.CheckBreak(); yyj1++ { + + if yyj1 >= len(yyv1) { + yyv1 = append(yyv1, CertificateSigningRequest{}) // var yyz1 CertificateSigningRequest + yyc1 = true + } + yyh1.ElemContainerState(yyj1) + if yyj1 < len(yyv1) { + if r.TryDecodeAsNil() { + yyv1[yyj1] = CertificateSigningRequest{} + } else { + yyv4 := &yyv1[yyj1] + yyv4.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1 < len(yyv1) { + yyv1 = yyv1[:yyj1] + yyc1 = true + } else if yyj1 == 0 && yyv1 == nil { + yyv1 = []CertificateSigningRequest{} + yyc1 = true + } + } + yyh1.End() + if yyc1 { + *v = yyv1 + } +} diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types.go new file mode 100644 index 000000000..5f046ba85 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types.go @@ -0,0 +1,85 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api/v1" +) + +// +genclient=true +// +nonNamespaced=true + +// Describes a certificate signing request +type CertificateSigningRequest struct { + unversioned.TypeMeta `json:",inline"` + v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // The certificate request itself and any additonal information. + Spec CertificateSigningRequestSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + // Derived information about the request. + Status CertificateSigningRequestStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// This information is immutable after the request is created. Only the Request +// and ExtraInfo fields can be set on creation, other fields are derived by +// Kubernetes and cannot be modified by users. +type CertificateSigningRequestSpec struct { + // Base64-encoded PKCS#10 CSR data + Request []byte `json:"request" protobuf:"bytes,1,opt,name=request"` + + // Information about the requesting user (if relevant) + // See user.Info interface for details + Username string `json:"username,omitempty" protobuf:"bytes,2,opt,name=username"` + UID string `json:"uid,omitempty" protobuf:"bytes,3,opt,name=uid"` + Groups []string `json:"groups,omitempty" protobuf:"bytes,4,rep,name=groups"` +} + +type CertificateSigningRequestStatus struct { + // Conditions applied to the request, such as approval or denial. + Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` + + // If request was approved, the controller will place the issued certificate here. + Certificate []byte `json:"certificate,omitempty" protobuf:"bytes,2,opt,name=certificate"` +} + +type RequestConditionType string + +// These are the possible conditions for a certificate request. +const ( + CertificateApproved RequestConditionType = "Approved" + CertificateDenied RequestConditionType = "Denied" +) + +type CertificateSigningRequestCondition struct { + // request approval state, currently Approved or Denied. + Type RequestConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=RequestConditionType"` + // brief reason for the request state + Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"` + // human readable message with details about the request state + Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` + // timestamp for the last update to this condition + LastUpdateTime unversioned.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,4,opt,name=lastUpdateTime"` +} + +type CertificateSigningRequestList struct { + unversioned.TypeMeta `json:",inline"` + unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + Items []CertificateSigningRequest `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types_swagger_doc_generated.go new file mode 100644 index 000000000..47b3b2821 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/certificates/v1alpha1/types_swagger_doc_generated.go @@ -0,0 +1,70 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-generated-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_CertificateSigningRequest = map[string]string{ + "": "Describes a certificate signing request", + "spec": "The certificate request itself and any additonal information.", + "status": "Derived information about the request.", +} + +func (CertificateSigningRequest) SwaggerDoc() map[string]string { + return map_CertificateSigningRequest +} + +var map_CertificateSigningRequestCondition = map[string]string{ + "type": "request approval state, currently Approved or Denied.", + "reason": "brief reason for the request state", + "message": "human readable message with details about the request state", + "lastUpdateTime": "timestamp for the last update to this condition", +} + +func (CertificateSigningRequestCondition) SwaggerDoc() map[string]string { + return map_CertificateSigningRequestCondition +} + +var map_CertificateSigningRequestSpec = map[string]string{ + "": "This information is immutable after the request is created. Only the Request and ExtraInfo fields can be set on creation, other fields are derived by Kubernetes and cannot be modified by users.", + "request": "Base64-encoded PKCS#10 CSR data", + "username": "Information about the requesting user (if relevant) See user.Info interface for details", +} + +func (CertificateSigningRequestSpec) SwaggerDoc() map[string]string { + return map_CertificateSigningRequestSpec +} + +var map_CertificateSigningRequestStatus = map[string]string{ + "conditions": "Conditions applied to the request, such as approval or denial.", + "certificate": "If request was approved, the controller will place the issued certificate here.", +} + +func (CertificateSigningRequestStatus) SwaggerDoc() map[string]string { + return map_CertificateSigningRequestStatus +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/deep_copy_generated.go index c18e2e5c3..37615c4da 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package componentconfig import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" ) @@ -55,9 +54,7 @@ func DeepCopy_componentconfig_IPVar(in IPVar, out *IPVar, c *conversion.Cloner) } func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in KubeControllerManagerConfiguration, out *KubeControllerManagerConfiguration, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Port = in.Port out.Address = in.Address out.CloudProvider = in.CloudProvider @@ -70,49 +67,26 @@ func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in KubeControll out.ConcurrentDaemonSetSyncs = in.ConcurrentDaemonSetSyncs out.ConcurrentJobSyncs = in.ConcurrentJobSyncs out.ConcurrentNamespaceSyncs = in.ConcurrentNamespaceSyncs + out.ConcurrentSATokenSyncs = in.ConcurrentSATokenSyncs out.LookupCacheSizeForRC = in.LookupCacheSizeForRC out.LookupCacheSizeForRS = in.LookupCacheSizeForRS out.LookupCacheSizeForDaemonSet = in.LookupCacheSizeForDaemonSet - if err := unversioned.DeepCopy_unversioned_Duration(in.ServiceSyncPeriod, &out.ServiceSyncPeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.NodeSyncPeriod, &out.NodeSyncPeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.ResourceQuotaSyncPeriod, &out.ResourceQuotaSyncPeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.NamespaceSyncPeriod, &out.NamespaceSyncPeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.PVClaimBinderSyncPeriod, &out.PVClaimBinderSyncPeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.MinResyncPeriod, &out.MinResyncPeriod, c); err != nil { - return err - } + out.ServiceSyncPeriod = in.ServiceSyncPeriod + out.NodeSyncPeriod = in.NodeSyncPeriod + out.ResourceQuotaSyncPeriod = in.ResourceQuotaSyncPeriod + out.NamespaceSyncPeriod = in.NamespaceSyncPeriod + out.PVClaimBinderSyncPeriod = in.PVClaimBinderSyncPeriod + out.MinResyncPeriod = in.MinResyncPeriod out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold - if err := unversioned.DeepCopy_unversioned_Duration(in.HorizontalPodAutoscalerSyncPeriod, &out.HorizontalPodAutoscalerSyncPeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.DeploymentControllerSyncPeriod, &out.DeploymentControllerSyncPeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.PodEvictionTimeout, &out.PodEvictionTimeout, c); err != nil { - return err - } + out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod + out.DeploymentControllerSyncPeriod = in.DeploymentControllerSyncPeriod + out.PodEvictionTimeout = in.PodEvictionTimeout out.DeletingPodsQps = in.DeletingPodsQps out.DeletingPodsBurst = in.DeletingPodsBurst - if err := unversioned.DeepCopy_unversioned_Duration(in.NodeMonitorGracePeriod, &out.NodeMonitorGracePeriod, c); err != nil { - return err - } + out.NodeMonitorGracePeriod = in.NodeMonitorGracePeriod out.RegisterRetryCount = in.RegisterRetryCount - if err := unversioned.DeepCopy_unversioned_Duration(in.NodeStartupGracePeriod, &out.NodeStartupGracePeriod, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.NodeMonitorPeriod, &out.NodeMonitorPeriod, c); err != nil { - return err - } + out.NodeStartupGracePeriod = in.NodeStartupGracePeriod + out.NodeMonitorPeriod = in.NodeMonitorPeriod out.ServiceAccountKeyFile = in.ServiceAccountKeyFile out.EnableProfiling = in.EnableProfiling out.ClusterName = in.ClusterName @@ -125,23 +99,15 @@ func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in KubeControll out.ContentType = in.ContentType out.KubeAPIQPS = in.KubeAPIQPS out.KubeAPIBurst = in.KubeAPIBurst - if err := DeepCopy_componentconfig_LeaderElectionConfiguration(in.LeaderElection, &out.LeaderElection, c); err != nil { - return err - } - if err := DeepCopy_componentconfig_VolumeConfiguration(in.VolumeConfiguration, &out.VolumeConfiguration, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.ControllerStartInterval, &out.ControllerStartInterval, c); err != nil { - return err - } + out.LeaderElection = in.LeaderElection + out.VolumeConfiguration = in.VolumeConfiguration + out.ControllerStartInterval = in.ControllerStartInterval out.EnableGarbageCollector = in.EnableGarbageCollector return nil } func DeepCopy_componentconfig_KubeProxyConfiguration(in KubeProxyConfiguration, out *KubeProxyConfiguration, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.BindAddress = in.BindAddress out.ClusterCIDR = in.ClusterCIDR out.HealthzBindAddress = in.HealthzBindAddress @@ -154,9 +120,7 @@ func DeepCopy_componentconfig_KubeProxyConfiguration(in KubeProxyConfiguration, } else { out.IPTablesMasqueradeBit = nil } - if err := unversioned.DeepCopy_unversioned_Duration(in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, c); err != nil { - return err - } + out.IPTablesSyncPeriod = in.IPTablesSyncPeriod out.KubeconfigPath = in.KubeconfigPath out.MasqueradeAll = in.MasqueradeAll out.Master = in.Master @@ -170,20 +134,14 @@ func DeepCopy_componentconfig_KubeProxyConfiguration(in KubeProxyConfiguration, out.Mode = in.Mode out.PortRange = in.PortRange out.ResourceContainer = in.ResourceContainer - if err := unversioned.DeepCopy_unversioned_Duration(in.UDPIdleTimeout, &out.UDPIdleTimeout, c); err != nil { - return err - } + out.UDPIdleTimeout = in.UDPIdleTimeout out.ConntrackMax = in.ConntrackMax - if err := unversioned.DeepCopy_unversioned_Duration(in.ConntrackTCPEstablishedTimeout, &out.ConntrackTCPEstablishedTimeout, c); err != nil { - return err - } + out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout return nil } func DeepCopy_componentconfig_KubeSchedulerConfiguration(in KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Port = in.Port out.Address = in.Address out.AlgorithmProvider = in.AlgorithmProvider @@ -195,23 +153,15 @@ func DeepCopy_componentconfig_KubeSchedulerConfiguration(in KubeSchedulerConfigu out.SchedulerName = in.SchedulerName out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight out.FailureDomains = in.FailureDomains - if err := DeepCopy_componentconfig_LeaderElectionConfiguration(in.LeaderElection, &out.LeaderElection, c); err != nil { - return err - } + out.LeaderElection = in.LeaderElection return nil } func DeepCopy_componentconfig_KubeletConfiguration(in KubeletConfiguration, out *KubeletConfiguration, c *conversion.Cloner) error { out.Config = in.Config - if err := unversioned.DeepCopy_unversioned_Duration(in.SyncFrequency, &out.SyncFrequency, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.FileCheckFrequency, &out.FileCheckFrequency, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.HTTPCheckFrequency, &out.HTTPCheckFrequency, c); err != nil { - return err - } + out.SyncFrequency = in.SyncFrequency + out.FileCheckFrequency = in.FileCheckFrequency + out.HTTPCheckFrequency = in.HTTPCheckFrequency out.ManifestURL = in.ManifestURL out.ManifestURLHeader = in.ManifestURLHeader out.EnableServer = in.EnableServer @@ -235,9 +185,7 @@ func DeepCopy_componentconfig_KubeletConfiguration(in KubeletConfiguration, out out.EventRecordQPS = in.EventRecordQPS out.EventBurst = in.EventBurst out.EnableDebuggingHandlers = in.EnableDebuggingHandlers - if err := unversioned.DeepCopy_unversioned_Duration(in.MinimumGCAge, &out.MinimumGCAge, c); err != nil { - return err - } + out.MinimumGCAge = in.MinimumGCAge out.MaxPerPodContainerCount = in.MaxPerPodContainerCount out.MaxContainerCount = in.MaxContainerCount out.CAdvisorPort = in.CAdvisorPort @@ -248,21 +196,13 @@ func DeepCopy_componentconfig_KubeletConfiguration(in KubeletConfiguration, out out.ClusterDomain = in.ClusterDomain out.MasterServiceNamespace = in.MasterServiceNamespace out.ClusterDNS = in.ClusterDNS - if err := unversioned.DeepCopy_unversioned_Duration(in.StreamingConnectionIdleTimeout, &out.StreamingConnectionIdleTimeout, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.NodeStatusUpdateFrequency, &out.NodeStatusUpdateFrequency, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.ImageMinimumGCAge, &out.ImageMinimumGCAge, c); err != nil { - return err - } + out.StreamingConnectionIdleTimeout = in.StreamingConnectionIdleTimeout + out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency + out.ImageMinimumGCAge = in.ImageMinimumGCAge out.ImageGCHighThresholdPercent = in.ImageGCHighThresholdPercent out.ImageGCLowThresholdPercent = in.ImageGCLowThresholdPercent out.LowDiskSpaceThresholdMB = in.LowDiskSpaceThresholdMB - if err := unversioned.DeepCopy_unversioned_Duration(in.VolumeStatsAggPeriod, &out.VolumeStatsAggPeriod, c); err != nil { - return err - } + out.VolumeStatsAggPeriod = in.VolumeStatsAggPeriod out.NetworkPluginName = in.NetworkPluginName out.NetworkPluginDir = in.NetworkPluginDir out.VolumePluginDir = in.VolumePluginDir @@ -273,9 +213,7 @@ func DeepCopy_componentconfig_KubeletConfiguration(in KubeletConfiguration, out out.SystemCgroups = in.SystemCgroups out.CgroupRoot = in.CgroupRoot out.ContainerRuntime = in.ContainerRuntime - if err := unversioned.DeepCopy_unversioned_Duration(in.RuntimeRequestTimeout, &out.RuntimeRequestTimeout, c); err != nil { - return err - } + out.RuntimeRequestTimeout = in.RuntimeRequestTimeout out.RktPath = in.RktPath out.RktAPIEndpoint = in.RktAPIEndpoint out.RktStage1Image = in.RktStage1Image @@ -299,9 +237,7 @@ func DeepCopy_componentconfig_KubeletConfiguration(in KubeletConfiguration, out out.KubeAPIBurst = in.KubeAPIBurst out.SerializeImagePulls = in.SerializeImagePulls out.ExperimentalFlannelOverlay = in.ExperimentalFlannelOverlay - if err := unversioned.DeepCopy_unversioned_Duration(in.OutOfDiskTransitionFrequency, &out.OutOfDiskTransitionFrequency, c); err != nil { - return err - } + out.OutOfDiskTransitionFrequency = in.OutOfDiskTransitionFrequency out.NodeIP = in.NodeIP if in.NodeLabels != nil { in, out := in.NodeLabels, &out.NodeLabels @@ -317,9 +253,7 @@ func DeepCopy_componentconfig_KubeletConfiguration(in KubeletConfiguration, out out.EvictionHard = in.EvictionHard out.EvictionSoft = in.EvictionSoft out.EvictionSoftGracePeriod = in.EvictionSoftGracePeriod - if err := unversioned.DeepCopy_unversioned_Duration(in.EvictionPressureTransitionPeriod, &out.EvictionPressureTransitionPeriod, c); err != nil { - return err - } + out.EvictionPressureTransitionPeriod = in.EvictionPressureTransitionPeriod out.EvictionMaxPodGracePeriod = in.EvictionMaxPodGracePeriod out.PodsPerCore = in.PodsPerCore out.EnableControllerAttachDetach = in.EnableControllerAttachDetach @@ -328,15 +262,9 @@ func DeepCopy_componentconfig_KubeletConfiguration(in KubeletConfiguration, out func DeepCopy_componentconfig_LeaderElectionConfiguration(in LeaderElectionConfiguration, out *LeaderElectionConfiguration, c *conversion.Cloner) error { out.LeaderElect = in.LeaderElect - if err := unversioned.DeepCopy_unversioned_Duration(in.LeaseDuration, &out.LeaseDuration, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.RenewDeadline, &out.RenewDeadline, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.RetryPeriod, &out.RetryPeriod, c); err != nil { - return err - } + out.LeaseDuration = in.LeaseDuration + out.RenewDeadline = in.RenewDeadline + out.RetryPeriod = in.RetryPeriod return nil } @@ -365,9 +293,7 @@ func DeepCopy_componentconfig_PortRangeVar(in PortRangeVar, out *PortRangeVar, c func DeepCopy_componentconfig_VolumeConfiguration(in VolumeConfiguration, out *VolumeConfiguration, c *conversion.Cloner) error { out.EnableHostPathProvisioning = in.EnableHostPathProvisioning out.EnableDynamicProvisioning = in.EnableDynamicProvisioning - if err := DeepCopy_componentconfig_PersistentVolumeRecyclerConfiguration(in.PersistentVolumeRecyclerConfiguration, &out.PersistentVolumeRecyclerConfiguration, c); err != nil { - return err - } + out.PersistentVolumeRecyclerConfiguration = in.PersistentVolumeRecyclerConfiguration out.FlexVolumePluginDir = in.FlexVolumePluginDir return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/doc.go new file mode 100644 index 000000000..d044b16db --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package componentconfig diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/helpers.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/helpers.go index edd9c7975..43b625b7e 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/helpers.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/helpers.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/install/install.go index ec5554273..1a8b0cd12 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/register.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/register.go index 0666c5431..599a44eb1 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.generated.go index b76ca11f9..c9fd4848f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6518,16 +6518,16 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [49]bool + var yyq2 [50]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[47] = x.Kind != "" - yyq2[48] = x.APIVersion != "" + yyq2[48] = x.Kind != "" + yyq2[49] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(49) + r.EncodeArrayStart(50) } else { - yynn2 = 47 + yynn2 = 48 for _, b := range yyq2 { if b { yynn2++ @@ -6770,17 +6770,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym40 if false { } else { - r.EncodeInt(int64(x.LookupCacheSizeForRC)) + r.EncodeInt(int64(x.ConcurrentSATokenSyncs)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("lookupCacheSizeForRC")) + r.EncodeString(codecSelferC_UTF81234, string("concurrentSATokenSyncs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym41 := z.EncBinary() _ = yym41 if false { } else { - r.EncodeInt(int64(x.LookupCacheSizeForRC)) + r.EncodeInt(int64(x.ConcurrentSATokenSyncs)) } } if yyr2 || yy2arr2 { @@ -6789,17 +6789,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym43 if false { } else { - r.EncodeInt(int64(x.LookupCacheSizeForRS)) + r.EncodeInt(int64(x.LookupCacheSizeForRC)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("lookupCacheSizeForRS")) + r.EncodeString(codecSelferC_UTF81234, string("lookupCacheSizeForRC")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym44 := z.EncBinary() _ = yym44 if false { } else { - r.EncodeInt(int64(x.LookupCacheSizeForRS)) + r.EncodeInt(int64(x.LookupCacheSizeForRC)) } } if yyr2 || yy2arr2 { @@ -6807,6 +6807,25 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode yym46 := z.EncBinary() _ = yym46 if false { + } else { + r.EncodeInt(int64(x.LookupCacheSizeForRS)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("lookupCacheSizeForRS")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym47 := z.EncBinary() + _ = yym47 + if false { + } else { + r.EncodeInt(int64(x.LookupCacheSizeForRS)) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym49 := z.EncBinary() + _ = yym49 + if false { } else { r.EncodeInt(int64(x.LookupCacheSizeForDaemonSet)) } @@ -6814,8 +6833,8 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lookupCacheSizeForDaemonSet")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym47 := z.EncBinary() - _ = yym47 + yym50 := z.EncBinary() + _ = yym50 if false { } else { r.EncodeInt(int64(x.LookupCacheSizeForDaemonSet)) @@ -6823,34 +6842,21 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy49 := &x.ServiceSyncPeriod - yym50 := z.EncBinary() - _ = yym50 + yy52 := &x.ServiceSyncPeriod + yym53 := z.EncBinary() + _ = yym53 if false { - } else if z.HasExtensions() && z.EncExt(yy49) { - } else if !yym50 && z.IsJSONHandle() { - z.EncJSONMarshal(yy49) + } else if z.HasExtensions() && z.EncExt(yy52) { + } else if !yym53 && z.IsJSONHandle() { + z.EncJSONMarshal(yy52) } else { - z.EncFallback(yy49) + z.EncFallback(yy52) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("serviceSyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy51 := &x.ServiceSyncPeriod - yym52 := z.EncBinary() - _ = yym52 - if false { - } else if z.HasExtensions() && z.EncExt(yy51) { - } else if !yym52 && z.IsJSONHandle() { - z.EncJSONMarshal(yy51) - } else { - z.EncFallback(yy51) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy54 := &x.NodeSyncPeriod + yy54 := &x.ServiceSyncPeriod yym55 := z.EncBinary() _ = yym55 if false { @@ -6860,24 +6866,24 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy54) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy57 := &x.NodeSyncPeriod + yym58 := z.EncBinary() + _ = yym58 + if false { + } else if z.HasExtensions() && z.EncExt(yy57) { + } else if !yym58 && z.IsJSONHandle() { + z.EncJSONMarshal(yy57) + } else { + z.EncFallback(yy57) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeSyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy56 := &x.NodeSyncPeriod - yym57 := z.EncBinary() - _ = yym57 - if false { - } else if z.HasExtensions() && z.EncExt(yy56) { - } else if !yym57 && z.IsJSONHandle() { - z.EncJSONMarshal(yy56) - } else { - z.EncFallback(yy56) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy59 := &x.ResourceQuotaSyncPeriod + yy59 := &x.NodeSyncPeriod yym60 := z.EncBinary() _ = yym60 if false { @@ -6887,24 +6893,24 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy59) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy62 := &x.ResourceQuotaSyncPeriod + yym63 := z.EncBinary() + _ = yym63 + if false { + } else if z.HasExtensions() && z.EncExt(yy62) { + } else if !yym63 && z.IsJSONHandle() { + z.EncJSONMarshal(yy62) + } else { + z.EncFallback(yy62) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resourceQuotaSyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy61 := &x.ResourceQuotaSyncPeriod - yym62 := z.EncBinary() - _ = yym62 - if false { - } else if z.HasExtensions() && z.EncExt(yy61) { - } else if !yym62 && z.IsJSONHandle() { - z.EncJSONMarshal(yy61) - } else { - z.EncFallback(yy61) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy64 := &x.NamespaceSyncPeriod + yy64 := &x.ResourceQuotaSyncPeriod yym65 := z.EncBinary() _ = yym65 if false { @@ -6914,24 +6920,24 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy64) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy67 := &x.NamespaceSyncPeriod + yym68 := z.EncBinary() + _ = yym68 + if false { + } else if z.HasExtensions() && z.EncExt(yy67) { + } else if !yym68 && z.IsJSONHandle() { + z.EncJSONMarshal(yy67) + } else { + z.EncFallback(yy67) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("namespaceSyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy66 := &x.NamespaceSyncPeriod - yym67 := z.EncBinary() - _ = yym67 - if false { - } else if z.HasExtensions() && z.EncExt(yy66) { - } else if !yym67 && z.IsJSONHandle() { - z.EncJSONMarshal(yy66) - } else { - z.EncFallback(yy66) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy69 := &x.PVClaimBinderSyncPeriod + yy69 := &x.NamespaceSyncPeriod yym70 := z.EncBinary() _ = yym70 if false { @@ -6941,24 +6947,24 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy69) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy72 := &x.PVClaimBinderSyncPeriod + yym73 := z.EncBinary() + _ = yym73 + if false { + } else if z.HasExtensions() && z.EncExt(yy72) { + } else if !yym73 && z.IsJSONHandle() { + z.EncJSONMarshal(yy72) + } else { + z.EncFallback(yy72) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("pvClaimBinderSyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy71 := &x.PVClaimBinderSyncPeriod - yym72 := z.EncBinary() - _ = yym72 - if false { - } else if z.HasExtensions() && z.EncExt(yy71) { - } else if !yym72 && z.IsJSONHandle() { - z.EncJSONMarshal(yy71) - } else { - z.EncFallback(yy71) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy74 := &x.MinResyncPeriod + yy74 := &x.PVClaimBinderSyncPeriod yym75 := z.EncBinary() _ = yym75 if false { @@ -6968,25 +6974,38 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy74) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy77 := &x.MinResyncPeriod + yym78 := z.EncBinary() + _ = yym78 + if false { + } else if z.HasExtensions() && z.EncExt(yy77) { + } else if !yym78 && z.IsJSONHandle() { + z.EncJSONMarshal(yy77) + } else { + z.EncFallback(yy77) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("minResyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy76 := &x.MinResyncPeriod - yym77 := z.EncBinary() - _ = yym77 + yy79 := &x.MinResyncPeriod + yym80 := z.EncBinary() + _ = yym80 if false { - } else if z.HasExtensions() && z.EncExt(yy76) { - } else if !yym77 && z.IsJSONHandle() { - z.EncJSONMarshal(yy76) + } else if z.HasExtensions() && z.EncExt(yy79) { + } else if !yym80 && z.IsJSONHandle() { + z.EncJSONMarshal(yy79) } else { - z.EncFallback(yy76) + z.EncFallback(yy79) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym79 := z.EncBinary() - _ = yym79 + yym82 := z.EncBinary() + _ = yym82 if false { } else { r.EncodeInt(int64(x.TerminatedPodGCThreshold)) @@ -6995,8 +7014,8 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("terminatedPodGCThreshold")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym80 := z.EncBinary() - _ = yym80 + yym83 := z.EncBinary() + _ = yym83 if false { } else { r.EncodeInt(int64(x.TerminatedPodGCThreshold)) @@ -7004,34 +7023,21 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy82 := &x.HorizontalPodAutoscalerSyncPeriod - yym83 := z.EncBinary() - _ = yym83 + yy85 := &x.HorizontalPodAutoscalerSyncPeriod + yym86 := z.EncBinary() + _ = yym86 if false { - } else if z.HasExtensions() && z.EncExt(yy82) { - } else if !yym83 && z.IsJSONHandle() { - z.EncJSONMarshal(yy82) + } else if z.HasExtensions() && z.EncExt(yy85) { + } else if !yym86 && z.IsJSONHandle() { + z.EncJSONMarshal(yy85) } else { - z.EncFallback(yy82) + z.EncFallback(yy85) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("horizontalPodAutoscalerSyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy84 := &x.HorizontalPodAutoscalerSyncPeriod - yym85 := z.EncBinary() - _ = yym85 - if false { - } else if z.HasExtensions() && z.EncExt(yy84) { - } else if !yym85 && z.IsJSONHandle() { - z.EncJSONMarshal(yy84) - } else { - z.EncFallback(yy84) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy87 := &x.DeploymentControllerSyncPeriod + yy87 := &x.HorizontalPodAutoscalerSyncPeriod yym88 := z.EncBinary() _ = yym88 if false { @@ -7041,24 +7047,24 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy87) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy90 := &x.DeploymentControllerSyncPeriod + yym91 := z.EncBinary() + _ = yym91 + if false { + } else if z.HasExtensions() && z.EncExt(yy90) { + } else if !yym91 && z.IsJSONHandle() { + z.EncJSONMarshal(yy90) + } else { + z.EncFallback(yy90) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("deploymentControllerSyncPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy89 := &x.DeploymentControllerSyncPeriod - yym90 := z.EncBinary() - _ = yym90 - if false { - } else if z.HasExtensions() && z.EncExt(yy89) { - } else if !yym90 && z.IsJSONHandle() { - z.EncJSONMarshal(yy89) - } else { - z.EncFallback(yy89) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy92 := &x.PodEvictionTimeout + yy92 := &x.DeploymentControllerSyncPeriod yym93 := z.EncBinary() _ = yym93 if false { @@ -7068,38 +7074,32 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy92) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy95 := &x.PodEvictionTimeout + yym96 := z.EncBinary() + _ = yym96 + if false { + } else if z.HasExtensions() && z.EncExt(yy95) { + } else if !yym96 && z.IsJSONHandle() { + z.EncJSONMarshal(yy95) + } else { + z.EncFallback(yy95) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("podEvictionTimeout")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy94 := &x.PodEvictionTimeout - yym95 := z.EncBinary() - _ = yym95 - if false { - } else if z.HasExtensions() && z.EncExt(yy94) { - } else if !yym95 && z.IsJSONHandle() { - z.EncJSONMarshal(yy94) - } else { - z.EncFallback(yy94) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym97 := z.EncBinary() - _ = yym97 - if false { - } else { - r.EncodeFloat32(float32(x.DeletingPodsQps)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("deletingPodsQps")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy97 := &x.PodEvictionTimeout yym98 := z.EncBinary() _ = yym98 if false { + } else if z.HasExtensions() && z.EncExt(yy97) { + } else if !yym98 && z.IsJSONHandle() { + z.EncJSONMarshal(yy97) } else { - r.EncodeFloat32(float32(x.DeletingPodsQps)) + z.EncFallback(yy97) } } if yyr2 || yy2arr2 { @@ -7107,6 +7107,25 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode yym100 := z.EncBinary() _ = yym100 if false { + } else { + r.EncodeFloat32(float32(x.DeletingPodsQps)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("deletingPodsQps")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym101 := z.EncBinary() + _ = yym101 + if false { + } else { + r.EncodeFloat32(float32(x.DeletingPodsQps)) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym103 := z.EncBinary() + _ = yym103 + if false { } else { r.EncodeInt(int64(x.DeletingPodsBurst)) } @@ -7114,8 +7133,8 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("deletingPodsBurst")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym101 := z.EncBinary() - _ = yym101 + yym104 := z.EncBinary() + _ = yym104 if false { } else { r.EncodeInt(int64(x.DeletingPodsBurst)) @@ -7123,35 +7142,35 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy103 := &x.NodeMonitorGracePeriod - yym104 := z.EncBinary() - _ = yym104 + yy106 := &x.NodeMonitorGracePeriod + yym107 := z.EncBinary() + _ = yym107 if false { - } else if z.HasExtensions() && z.EncExt(yy103) { - } else if !yym104 && z.IsJSONHandle() { - z.EncJSONMarshal(yy103) + } else if z.HasExtensions() && z.EncExt(yy106) { + } else if !yym107 && z.IsJSONHandle() { + z.EncJSONMarshal(yy106) } else { - z.EncFallback(yy103) + z.EncFallback(yy106) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeMonitorGracePeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy105 := &x.NodeMonitorGracePeriod - yym106 := z.EncBinary() - _ = yym106 + yy108 := &x.NodeMonitorGracePeriod + yym109 := z.EncBinary() + _ = yym109 if false { - } else if z.HasExtensions() && z.EncExt(yy105) { - } else if !yym106 && z.IsJSONHandle() { - z.EncJSONMarshal(yy105) + } else if z.HasExtensions() && z.EncExt(yy108) { + } else if !yym109 && z.IsJSONHandle() { + z.EncJSONMarshal(yy108) } else { - z.EncFallback(yy105) + z.EncFallback(yy108) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym108 := z.EncBinary() - _ = yym108 + yym111 := z.EncBinary() + _ = yym111 if false { } else { r.EncodeInt(int64(x.RegisterRetryCount)) @@ -7160,8 +7179,8 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("registerRetryCount")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym109 := z.EncBinary() - _ = yym109 + yym112 := z.EncBinary() + _ = yym112 if false { } else { r.EncodeInt(int64(x.RegisterRetryCount)) @@ -7169,34 +7188,21 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy111 := &x.NodeStartupGracePeriod - yym112 := z.EncBinary() - _ = yym112 + yy114 := &x.NodeStartupGracePeriod + yym115 := z.EncBinary() + _ = yym115 if false { - } else if z.HasExtensions() && z.EncExt(yy111) { - } else if !yym112 && z.IsJSONHandle() { - z.EncJSONMarshal(yy111) + } else if z.HasExtensions() && z.EncExt(yy114) { + } else if !yym115 && z.IsJSONHandle() { + z.EncJSONMarshal(yy114) } else { - z.EncFallback(yy111) + z.EncFallback(yy114) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeStartupGracePeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy113 := &x.NodeStartupGracePeriod - yym114 := z.EncBinary() - _ = yym114 - if false { - } else if z.HasExtensions() && z.EncExt(yy113) { - } else if !yym114 && z.IsJSONHandle() { - z.EncJSONMarshal(yy113) - } else { - z.EncFallback(yy113) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy116 := &x.NodeMonitorPeriod + yy116 := &x.NodeStartupGracePeriod yym117 := z.EncBinary() _ = yym117 if false { @@ -7206,38 +7212,32 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { z.EncFallback(yy116) } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy119 := &x.NodeMonitorPeriod + yym120 := z.EncBinary() + _ = yym120 + if false { + } else if z.HasExtensions() && z.EncExt(yy119) { + } else if !yym120 && z.IsJSONHandle() { + z.EncJSONMarshal(yy119) + } else { + z.EncFallback(yy119) + } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeMonitorPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy118 := &x.NodeMonitorPeriod - yym119 := z.EncBinary() - _ = yym119 - if false { - } else if z.HasExtensions() && z.EncExt(yy118) { - } else if !yym119 && z.IsJSONHandle() { - z.EncJSONMarshal(yy118) - } else { - z.EncFallback(yy118) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym121 := z.EncBinary() - _ = yym121 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountKeyFile)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("serviceAccountKeyFile")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy121 := &x.NodeMonitorPeriod yym122 := z.EncBinary() _ = yym122 if false { + } else if z.HasExtensions() && z.EncExt(yy121) { + } else if !yym122 && z.IsJSONHandle() { + z.EncJSONMarshal(yy121) } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountKeyFile)) + z.EncFallback(yy121) } } if yyr2 || yy2arr2 { @@ -7246,17 +7246,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym124 if false { } else { - r.EncodeBool(bool(x.EnableProfiling)) + r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountKeyFile)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("enableProfiling")) + r.EncodeString(codecSelferC_UTF81234, string("serviceAccountKeyFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym125 := z.EncBinary() _ = yym125 if false { } else { - r.EncodeBool(bool(x.EnableProfiling)) + r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountKeyFile)) } } if yyr2 || yy2arr2 { @@ -7265,17 +7265,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym127 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClusterName)) + r.EncodeBool(bool(x.EnableProfiling)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("clusterName")) + r.EncodeString(codecSelferC_UTF81234, string("enableProfiling")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym128 := z.EncBinary() _ = yym128 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClusterName)) + r.EncodeBool(bool(x.EnableProfiling)) } } if yyr2 || yy2arr2 { @@ -7284,17 +7284,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym130 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClusterCIDR)) + r.EncodeString(codecSelferC_UTF81234, string(x.ClusterName)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("clusterCIDR")) + r.EncodeString(codecSelferC_UTF81234, string("clusterName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym131 := z.EncBinary() _ = yym131 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClusterCIDR)) + r.EncodeString(codecSelferC_UTF81234, string(x.ClusterName)) } } if yyr2 || yy2arr2 { @@ -7303,17 +7303,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym133 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServiceCIDR)) + r.EncodeString(codecSelferC_UTF81234, string(x.ClusterCIDR)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("serviceCIDR")) + r.EncodeString(codecSelferC_UTF81234, string("clusterCIDR")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym134 := z.EncBinary() _ = yym134 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServiceCIDR)) + r.EncodeString(codecSelferC_UTF81234, string(x.ClusterCIDR)) } } if yyr2 || yy2arr2 { @@ -7322,17 +7322,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym136 if false { } else { - r.EncodeInt(int64(x.NodeCIDRMaskSize)) + r.EncodeString(codecSelferC_UTF81234, string(x.ServiceCIDR)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("nodeCIDRMaskSize")) + r.EncodeString(codecSelferC_UTF81234, string("serviceCIDR")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym137 := z.EncBinary() _ = yym137 if false { } else { - r.EncodeInt(int64(x.NodeCIDRMaskSize)) + r.EncodeString(codecSelferC_UTF81234, string(x.ServiceCIDR)) } } if yyr2 || yy2arr2 { @@ -7341,17 +7341,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym139 if false { } else { - r.EncodeBool(bool(x.AllocateNodeCIDRs)) + r.EncodeInt(int64(x.NodeCIDRMaskSize)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("allocateNodeCIDRs")) + r.EncodeString(codecSelferC_UTF81234, string("nodeCIDRMaskSize")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym140 := z.EncBinary() _ = yym140 if false { } else { - r.EncodeBool(bool(x.AllocateNodeCIDRs)) + r.EncodeInt(int64(x.NodeCIDRMaskSize)) } } if yyr2 || yy2arr2 { @@ -7360,17 +7360,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym142 if false { } else { - r.EncodeBool(bool(x.ConfigureCloudRoutes)) + r.EncodeBool(bool(x.AllocateNodeCIDRs)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("configureCloudRoutes")) + r.EncodeString(codecSelferC_UTF81234, string("allocateNodeCIDRs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym143 := z.EncBinary() _ = yym143 if false { } else { - r.EncodeBool(bool(x.ConfigureCloudRoutes)) + r.EncodeBool(bool(x.AllocateNodeCIDRs)) } } if yyr2 || yy2arr2 { @@ -7379,17 +7379,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym145 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.RootCAFile)) + r.EncodeBool(bool(x.ConfigureCloudRoutes)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("rootCAFile")) + r.EncodeString(codecSelferC_UTF81234, string("configureCloudRoutes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym146 := z.EncBinary() _ = yym146 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.RootCAFile)) + r.EncodeBool(bool(x.ConfigureCloudRoutes)) } } if yyr2 || yy2arr2 { @@ -7398,17 +7398,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym148 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ContentType)) + r.EncodeString(codecSelferC_UTF81234, string(x.RootCAFile)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("contentType")) + r.EncodeString(codecSelferC_UTF81234, string("rootCAFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym149 := z.EncBinary() _ = yym149 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ContentType)) + r.EncodeString(codecSelferC_UTF81234, string(x.RootCAFile)) } } if yyr2 || yy2arr2 { @@ -7417,17 +7417,17 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym151 if false { } else { - r.EncodeFloat32(float32(x.KubeAPIQPS)) + r.EncodeString(codecSelferC_UTF81234, string(x.ContentType)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kubeAPIQPS")) + r.EncodeString(codecSelferC_UTF81234, string("contentType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym152 := z.EncBinary() _ = yym152 if false { } else { - r.EncodeFloat32(float32(x.KubeAPIQPS)) + r.EncodeString(codecSelferC_UTF81234, string(x.ContentType)) } } if yyr2 || yy2arr2 { @@ -7435,6 +7435,25 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode yym154 := z.EncBinary() _ = yym154 if false { + } else { + r.EncodeFloat32(float32(x.KubeAPIQPS)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kubeAPIQPS")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym155 := z.EncBinary() + _ = yym155 + if false { + } else { + r.EncodeFloat32(float32(x.KubeAPIQPS)) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym157 := z.EncBinary() + _ = yym157 + if false { } else { r.EncodeInt(int64(x.KubeAPIBurst)) } @@ -7442,8 +7461,8 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeAPIBurst")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym155 := z.EncBinary() - _ = yym155 + yym158 := z.EncBinary() + _ = yym158 if false { } else { r.EncodeInt(int64(x.KubeAPIBurst)) @@ -7451,57 +7470,57 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy157 := &x.LeaderElection - yy157.CodecEncodeSelf(e) + yy160 := &x.LeaderElection + yy160.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("leaderElection")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy159 := &x.LeaderElection - yy159.CodecEncodeSelf(e) + yy162 := &x.LeaderElection + yy162.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy162 := &x.VolumeConfiguration - yy162.CodecEncodeSelf(e) + yy165 := &x.VolumeConfiguration + yy165.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeConfiguration")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy164 := &x.VolumeConfiguration - yy164.CodecEncodeSelf(e) + yy167 := &x.VolumeConfiguration + yy167.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy167 := &x.ControllerStartInterval - yym168 := z.EncBinary() - _ = yym168 + yy170 := &x.ControllerStartInterval + yym171 := z.EncBinary() + _ = yym171 if false { - } else if z.HasExtensions() && z.EncExt(yy167) { - } else if !yym168 && z.IsJSONHandle() { - z.EncJSONMarshal(yy167) + } else if z.HasExtensions() && z.EncExt(yy170) { + } else if !yym171 && z.IsJSONHandle() { + z.EncJSONMarshal(yy170) } else { - z.EncFallback(yy167) + z.EncFallback(yy170) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("controllerStartInterval")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy169 := &x.ControllerStartInterval - yym170 := z.EncBinary() - _ = yym170 + yy172 := &x.ControllerStartInterval + yym173 := z.EncBinary() + _ = yym173 if false { - } else if z.HasExtensions() && z.EncExt(yy169) { - } else if !yym170 && z.IsJSONHandle() { - z.EncJSONMarshal(yy169) + } else if z.HasExtensions() && z.EncExt(yy172) { + } else if !yym173 && z.IsJSONHandle() { + z.EncJSONMarshal(yy172) } else { - z.EncFallback(yy169) + z.EncFallback(yy172) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym172 := z.EncBinary() - _ = yym172 + yym175 := z.EncBinary() + _ = yym175 if false { } else { r.EncodeBool(bool(x.EnableGarbageCollector)) @@ -7510,38 +7529,13 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("enableGarbageCollector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym173 := z.EncBinary() - _ = yym173 + yym176 := z.EncBinary() + _ = yym176 if false { } else { r.EncodeBool(bool(x.EnableGarbageCollector)) } } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[47] { - yym175 := z.EncBinary() - _ = yym175 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[47] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym176 := z.EncBinary() - _ = yym176 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq2[48] { @@ -7549,7 +7543,7 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode _ = yym178 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -7557,11 +7551,36 @@ func (x *KubeControllerManagerConfiguration) CodecEncodeSelf(e *codec1978.Encode } else { if yyq2[48] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym179 := z.EncBinary() _ = yym179 if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[49] { + yym181 := z.EncBinary() + _ = yym181 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[49] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym182 := z.EncBinary() + _ = yym182 + if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } @@ -7700,6 +7719,12 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromMap(l int, d *co } else { x.ConcurrentNamespaceSyncs = int32(r.DecodeInt(32)) } + case "concurrentSATokenSyncs": + if r.TryDecodeAsNil() { + x.ConcurrentSATokenSyncs = 0 + } else { + x.ConcurrentSATokenSyncs = int32(r.DecodeInt(32)) + } case "lookupCacheSizeForRC": if r.TryDecodeAsNil() { x.LookupCacheSizeForRC = 0 @@ -7722,90 +7747,90 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromMap(l int, d *co if r.TryDecodeAsNil() { x.ServiceSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv19 := &x.ServiceSyncPeriod - yym20 := z.DecBinary() - _ = yym20 + yyv20 := &x.ServiceSyncPeriod + yym21 := z.DecBinary() + _ = yym21 if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else if !yym20 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv19) + } else if z.HasExtensions() && z.DecExt(yyv20) { + } else if !yym21 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv20) } else { - z.DecFallback(yyv19, false) + z.DecFallback(yyv20, false) } } case "nodeSyncPeriod": if r.TryDecodeAsNil() { x.NodeSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv21 := &x.NodeSyncPeriod - yym22 := z.DecBinary() - _ = yym22 + yyv22 := &x.NodeSyncPeriod + yym23 := z.DecBinary() + _ = yym23 if false { - } else if z.HasExtensions() && z.DecExt(yyv21) { - } else if !yym22 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv21) + } else if z.HasExtensions() && z.DecExt(yyv22) { + } else if !yym23 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv22) } else { - z.DecFallback(yyv21, false) + z.DecFallback(yyv22, false) } } case "resourceQuotaSyncPeriod": if r.TryDecodeAsNil() { x.ResourceQuotaSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv23 := &x.ResourceQuotaSyncPeriod - yym24 := z.DecBinary() - _ = yym24 + yyv24 := &x.ResourceQuotaSyncPeriod + yym25 := z.DecBinary() + _ = yym25 if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else if !yym24 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv23) + } else if z.HasExtensions() && z.DecExt(yyv24) { + } else if !yym25 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv24) } else { - z.DecFallback(yyv23, false) + z.DecFallback(yyv24, false) } } case "namespaceSyncPeriod": if r.TryDecodeAsNil() { x.NamespaceSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv25 := &x.NamespaceSyncPeriod - yym26 := z.DecBinary() - _ = yym26 + yyv26 := &x.NamespaceSyncPeriod + yym27 := z.DecBinary() + _ = yym27 if false { - } else if z.HasExtensions() && z.DecExt(yyv25) { - } else if !yym26 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv25) + } else if z.HasExtensions() && z.DecExt(yyv26) { + } else if !yym27 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv26) } else { - z.DecFallback(yyv25, false) + z.DecFallback(yyv26, false) } } case "pvClaimBinderSyncPeriod": if r.TryDecodeAsNil() { x.PVClaimBinderSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv27 := &x.PVClaimBinderSyncPeriod - yym28 := z.DecBinary() - _ = yym28 + yyv28 := &x.PVClaimBinderSyncPeriod + yym29 := z.DecBinary() + _ = yym29 if false { - } else if z.HasExtensions() && z.DecExt(yyv27) { - } else if !yym28 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv27) + } else if z.HasExtensions() && z.DecExt(yyv28) { + } else if !yym29 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv28) } else { - z.DecFallback(yyv27, false) + z.DecFallback(yyv28, false) } } case "minResyncPeriod": if r.TryDecodeAsNil() { x.MinResyncPeriod = pkg1_unversioned.Duration{} } else { - yyv29 := &x.MinResyncPeriod - yym30 := z.DecBinary() - _ = yym30 + yyv30 := &x.MinResyncPeriod + yym31 := z.DecBinary() + _ = yym31 if false { - } else if z.HasExtensions() && z.DecExt(yyv29) { - } else if !yym30 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv29) + } else if z.HasExtensions() && z.DecExt(yyv30) { + } else if !yym31 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv30) } else { - z.DecFallback(yyv29, false) + z.DecFallback(yyv30, false) } } case "terminatedPodGCThreshold": @@ -7818,45 +7843,45 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromMap(l int, d *co if r.TryDecodeAsNil() { x.HorizontalPodAutoscalerSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv32 := &x.HorizontalPodAutoscalerSyncPeriod - yym33 := z.DecBinary() - _ = yym33 + yyv33 := &x.HorizontalPodAutoscalerSyncPeriod + yym34 := z.DecBinary() + _ = yym34 if false { - } else if z.HasExtensions() && z.DecExt(yyv32) { - } else if !yym33 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv32) + } else if z.HasExtensions() && z.DecExt(yyv33) { + } else if !yym34 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv33) } else { - z.DecFallback(yyv32, false) + z.DecFallback(yyv33, false) } } case "deploymentControllerSyncPeriod": if r.TryDecodeAsNil() { x.DeploymentControllerSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv34 := &x.DeploymentControllerSyncPeriod - yym35 := z.DecBinary() - _ = yym35 + yyv35 := &x.DeploymentControllerSyncPeriod + yym36 := z.DecBinary() + _ = yym36 if false { - } else if z.HasExtensions() && z.DecExt(yyv34) { - } else if !yym35 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv34) + } else if z.HasExtensions() && z.DecExt(yyv35) { + } else if !yym36 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv35) } else { - z.DecFallback(yyv34, false) + z.DecFallback(yyv35, false) } } case "podEvictionTimeout": if r.TryDecodeAsNil() { x.PodEvictionTimeout = pkg1_unversioned.Duration{} } else { - yyv36 := &x.PodEvictionTimeout - yym37 := z.DecBinary() - _ = yym37 + yyv37 := &x.PodEvictionTimeout + yym38 := z.DecBinary() + _ = yym38 if false { - } else if z.HasExtensions() && z.DecExt(yyv36) { - } else if !yym37 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv36) + } else if z.HasExtensions() && z.DecExt(yyv37) { + } else if !yym38 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv37) } else { - z.DecFallback(yyv36, false) + z.DecFallback(yyv37, false) } } case "deletingPodsQps": @@ -7875,15 +7900,15 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromMap(l int, d *co if r.TryDecodeAsNil() { x.NodeMonitorGracePeriod = pkg1_unversioned.Duration{} } else { - yyv40 := &x.NodeMonitorGracePeriod - yym41 := z.DecBinary() - _ = yym41 + yyv41 := &x.NodeMonitorGracePeriod + yym42 := z.DecBinary() + _ = yym42 if false { - } else if z.HasExtensions() && z.DecExt(yyv40) { - } else if !yym41 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv40) + } else if z.HasExtensions() && z.DecExt(yyv41) { + } else if !yym42 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv41) } else { - z.DecFallback(yyv40, false) + z.DecFallback(yyv41, false) } } case "registerRetryCount": @@ -7896,30 +7921,30 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromMap(l int, d *co if r.TryDecodeAsNil() { x.NodeStartupGracePeriod = pkg1_unversioned.Duration{} } else { - yyv43 := &x.NodeStartupGracePeriod - yym44 := z.DecBinary() - _ = yym44 + yyv44 := &x.NodeStartupGracePeriod + yym45 := z.DecBinary() + _ = yym45 if false { - } else if z.HasExtensions() && z.DecExt(yyv43) { - } else if !yym44 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv43) + } else if z.HasExtensions() && z.DecExt(yyv44) { + } else if !yym45 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv44) } else { - z.DecFallback(yyv43, false) + z.DecFallback(yyv44, false) } } case "nodeMonitorPeriod": if r.TryDecodeAsNil() { x.NodeMonitorPeriod = pkg1_unversioned.Duration{} } else { - yyv45 := &x.NodeMonitorPeriod - yym46 := z.DecBinary() - _ = yym46 + yyv46 := &x.NodeMonitorPeriod + yym47 := z.DecBinary() + _ = yym47 if false { - } else if z.HasExtensions() && z.DecExt(yyv45) { - } else if !yym46 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv45) + } else if z.HasExtensions() && z.DecExt(yyv46) { + } else if !yym47 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv46) } else { - z.DecFallback(yyv45, false) + z.DecFallback(yyv46, false) } } case "serviceAccountKeyFile": @@ -7998,29 +8023,29 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromMap(l int, d *co if r.TryDecodeAsNil() { x.LeaderElection = LeaderElectionConfiguration{} } else { - yyv59 := &x.LeaderElection - yyv59.CodecDecodeSelf(d) + yyv60 := &x.LeaderElection + yyv60.CodecDecodeSelf(d) } case "volumeConfiguration": if r.TryDecodeAsNil() { x.VolumeConfiguration = VolumeConfiguration{} } else { - yyv60 := &x.VolumeConfiguration - yyv60.CodecDecodeSelf(d) + yyv61 := &x.VolumeConfiguration + yyv61.CodecDecodeSelf(d) } case "controllerStartInterval": if r.TryDecodeAsNil() { x.ControllerStartInterval = pkg1_unversioned.Duration{} } else { - yyv61 := &x.ControllerStartInterval - yym62 := z.DecBinary() - _ = yym62 + yyv62 := &x.ControllerStartInterval + yym63 := z.DecBinary() + _ = yym63 if false { - } else if z.HasExtensions() && z.DecExt(yyv61) { - } else if !yym62 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv61) + } else if z.HasExtensions() && z.DecExt(yyv62) { + } else if !yym63 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv62) } else { - z.DecFallback(yyv61, false) + z.DecFallback(yyv62, false) } } case "enableGarbageCollector": @@ -8052,16 +8077,16 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj66 int - var yyb66 bool - var yyhl66 bool = l >= 0 - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + var yyj67 int + var yyb67 bool + var yyhl67 bool = l >= 0 + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8071,13 +8096,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.Port = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8087,13 +8112,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.Address = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8103,13 +8128,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.CloudProvider = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8119,13 +8144,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.CloudConfigFile = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8135,13 +8160,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentEndpointSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8151,13 +8176,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentRSSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8167,13 +8192,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentRCSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8183,13 +8208,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentResourceQuotaSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8199,13 +8224,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentDeploymentSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8215,13 +8240,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentDaemonSetSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8231,13 +8256,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentJobSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8247,13 +8272,29 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConcurrentNamespaceSyncs = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ConcurrentSATokenSyncs = 0 + } else { + x.ConcurrentSATokenSyncs = int32(r.DecodeInt(32)) + } + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l + } else { + yyb67 = r.CheckBreak() + } + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8263,13 +8304,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.LookupCacheSizeForRC = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8279,13 +8320,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.LookupCacheSizeForRS = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8295,13 +8336,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.LookupCacheSizeForDaemonSet = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8309,32 +8350,7 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * if r.TryDecodeAsNil() { x.ServiceSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv82 := &x.ServiceSyncPeriod - yym83 := z.DecBinary() - _ = yym83 - if false { - } else if z.HasExtensions() && z.DecExt(yyv82) { - } else if !yym83 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv82) - } else { - z.DecFallback(yyv82, false) - } - } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l - } else { - yyb66 = r.CheckBreak() - } - if yyb66 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.NodeSyncPeriod = pkg1_unversioned.Duration{} - } else { - yyv84 := &x.NodeSyncPeriod + yyv84 := &x.ServiceSyncPeriod yym85 := z.DecBinary() _ = yym85 if false { @@ -8345,21 +8361,21 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv84, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.ResourceQuotaSyncPeriod = pkg1_unversioned.Duration{} + x.NodeSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv86 := &x.ResourceQuotaSyncPeriod + yyv86 := &x.NodeSyncPeriod yym87 := z.DecBinary() _ = yym87 if false { @@ -8370,21 +8386,21 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv86, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.NamespaceSyncPeriod = pkg1_unversioned.Duration{} + x.ResourceQuotaSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv88 := &x.NamespaceSyncPeriod + yyv88 := &x.ResourceQuotaSyncPeriod yym89 := z.DecBinary() _ = yym89 if false { @@ -8395,21 +8411,21 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv88, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.PVClaimBinderSyncPeriod = pkg1_unversioned.Duration{} + x.NamespaceSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv90 := &x.PVClaimBinderSyncPeriod + yyv90 := &x.NamespaceSyncPeriod yym91 := z.DecBinary() _ = yym91 if false { @@ -8420,21 +8436,21 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv90, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.MinResyncPeriod = pkg1_unversioned.Duration{} + x.PVClaimBinderSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv92 := &x.MinResyncPeriod + yyv92 := &x.PVClaimBinderSyncPeriod yym93 := z.DecBinary() _ = yym93 if false { @@ -8445,13 +8461,38 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv92, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.MinResyncPeriod = pkg1_unversioned.Duration{} + } else { + yyv94 := &x.MinResyncPeriod + yym95 := z.DecBinary() + _ = yym95 + if false { + } else if z.HasExtensions() && z.DecExt(yyv94) { + } else if !yym95 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv94) + } else { + z.DecFallback(yyv94, false) + } + } + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l + } else { + yyb67 = r.CheckBreak() + } + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8461,13 +8502,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.TerminatedPodGCThreshold = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8475,32 +8516,7 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * if r.TryDecodeAsNil() { x.HorizontalPodAutoscalerSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv95 := &x.HorizontalPodAutoscalerSyncPeriod - yym96 := z.DecBinary() - _ = yym96 - if false { - } else if z.HasExtensions() && z.DecExt(yyv95) { - } else if !yym96 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv95) - } else { - z.DecFallback(yyv95, false) - } - } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l - } else { - yyb66 = r.CheckBreak() - } - if yyb66 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.DeploymentControllerSyncPeriod = pkg1_unversioned.Duration{} - } else { - yyv97 := &x.DeploymentControllerSyncPeriod + yyv97 := &x.HorizontalPodAutoscalerSyncPeriod yym98 := z.DecBinary() _ = yym98 if false { @@ -8511,21 +8527,21 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv97, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.PodEvictionTimeout = pkg1_unversioned.Duration{} + x.DeploymentControllerSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv99 := &x.PodEvictionTimeout + yyv99 := &x.DeploymentControllerSyncPeriod yym100 := z.DecBinary() _ = yym100 if false { @@ -8536,13 +8552,38 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv99, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PodEvictionTimeout = pkg1_unversioned.Duration{} + } else { + yyv101 := &x.PodEvictionTimeout + yym102 := z.DecBinary() + _ = yym102 + if false { + } else if z.HasExtensions() && z.DecExt(yyv101) { + } else if !yym102 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv101) + } else { + z.DecFallback(yyv101, false) + } + } + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l + } else { + yyb67 = r.CheckBreak() + } + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8552,13 +8593,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.DeletingPodsQps = float32(r.DecodeFloat(true)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8568,13 +8609,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.DeletingPodsBurst = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8582,24 +8623,24 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * if r.TryDecodeAsNil() { x.NodeMonitorGracePeriod = pkg1_unversioned.Duration{} } else { - yyv103 := &x.NodeMonitorGracePeriod - yym104 := z.DecBinary() - _ = yym104 + yyv105 := &x.NodeMonitorGracePeriod + yym106 := z.DecBinary() + _ = yym106 if false { - } else if z.HasExtensions() && z.DecExt(yyv103) { - } else if !yym104 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv103) + } else if z.HasExtensions() && z.DecExt(yyv105) { + } else if !yym106 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv105) } else { - z.DecFallback(yyv103, false) + z.DecFallback(yyv105, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8609,13 +8650,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.RegisterRetryCount = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8623,32 +8664,7 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * if r.TryDecodeAsNil() { x.NodeStartupGracePeriod = pkg1_unversioned.Duration{} } else { - yyv106 := &x.NodeStartupGracePeriod - yym107 := z.DecBinary() - _ = yym107 - if false { - } else if z.HasExtensions() && z.DecExt(yyv106) { - } else if !yym107 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv106) - } else { - z.DecFallback(yyv106, false) - } - } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l - } else { - yyb66 = r.CheckBreak() - } - if yyb66 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.NodeMonitorPeriod = pkg1_unversioned.Duration{} - } else { - yyv108 := &x.NodeMonitorPeriod + yyv108 := &x.NodeStartupGracePeriod yym109 := z.DecBinary() _ = yym109 if false { @@ -8659,13 +8675,38 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * z.DecFallback(yyv108, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.NodeMonitorPeriod = pkg1_unversioned.Duration{} + } else { + yyv110 := &x.NodeMonitorPeriod + yym111 := z.DecBinary() + _ = yym111 + if false { + } else if z.HasExtensions() && z.DecExt(yyv110) { + } else if !yym111 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv110) + } else { + z.DecFallback(yyv110, false) + } + } + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l + } else { + yyb67 = r.CheckBreak() + } + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8675,13 +8716,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ServiceAccountKeyFile = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8691,13 +8732,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.EnableProfiling = bool(r.DecodeBool()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8707,13 +8748,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ClusterName = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8723,13 +8764,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ClusterCIDR = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8739,13 +8780,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ServiceCIDR = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8755,13 +8796,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.NodeCIDRMaskSize = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8771,13 +8812,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.AllocateNodeCIDRs = bool(r.DecodeBool()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8787,13 +8828,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ConfigureCloudRoutes = bool(r.DecodeBool()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8803,13 +8844,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.RootCAFile = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8819,13 +8860,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.ContentType = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8835,13 +8876,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.KubeAPIQPS = float32(r.DecodeFloat(true)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8851,13 +8892,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.KubeAPIBurst = int32(r.DecodeInt(32)) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8865,16 +8906,16 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * if r.TryDecodeAsNil() { x.LeaderElection = LeaderElectionConfiguration{} } else { - yyv122 := &x.LeaderElection - yyv122.CodecDecodeSelf(d) + yyv124 := &x.LeaderElection + yyv124.CodecDecodeSelf(d) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8882,16 +8923,16 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * if r.TryDecodeAsNil() { x.VolumeConfiguration = VolumeConfiguration{} } else { - yyv123 := &x.VolumeConfiguration - yyv123.CodecDecodeSelf(d) + yyv125 := &x.VolumeConfiguration + yyv125.CodecDecodeSelf(d) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8899,24 +8940,24 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * if r.TryDecodeAsNil() { x.ControllerStartInterval = pkg1_unversioned.Duration{} } else { - yyv124 := &x.ControllerStartInterval - yym125 := z.DecBinary() - _ = yym125 + yyv126 := &x.ControllerStartInterval + yym127 := z.DecBinary() + _ = yym127 if false { - } else if z.HasExtensions() && z.DecExt(yyv124) { - } else if !yym125 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv124) + } else if z.HasExtensions() && z.DecExt(yyv126) { + } else if !yym127 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv126) } else { - z.DecFallback(yyv124, false) + z.DecFallback(yyv126, false) } } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8926,13 +8967,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.EnableGarbageCollector = bool(r.DecodeBool()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8942,13 +8983,13 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * } else { x.Kind = string(r.DecodeString()) } - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8959,17 +9000,17 @@ func (x *KubeControllerManagerConfiguration) codecDecodeSelfFromArray(l int, d * x.APIVersion = string(r.DecodeString()) } for { - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l + yyj67++ + if yyhl67 { + yyb67 = yyj67 > l } else { - yyb66 = r.CheckBreak() + yyb67 = r.CheckBreak() } - if yyb66 { + if yyb67 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj66-1, "") + z.DecStructFieldNotFound(yyj67-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.go index 6121048b4..97e923337 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -471,6 +471,9 @@ type KubeControllerManagerConfiguration struct { // concurrentNamespaceSyncs is the number of namespace objects that are // allowed to sync concurrently. ConcurrentNamespaceSyncs int32 `json:"concurrentNamespaceSyncs"` + // concurrentSATokenSyncs is the number of service account token syncing operations + // that will be done concurrently. + ConcurrentSATokenSyncs int32 `json:"concurrentSATokenSyncs"` // lookupCacheSizeForRC is the size of lookup cache for replication controllers. // Larger number = more responsive replica management, but more MEM load. LookupCacheSizeForRC int32 `json:"lookupCacheSizeForRC"` diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go index fd607760b..160b0f918 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go index f4f9fc932..04d9ab09b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package v1alpha1 import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" ) @@ -38,9 +37,7 @@ func init() { } func DeepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *KubeProxyConfiguration, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.BindAddress = in.BindAddress out.ClusterCIDR = in.ClusterCIDR out.HealthzBindAddress = in.HealthzBindAddress @@ -53,9 +50,7 @@ func DeepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *Ku } else { out.IPTablesMasqueradeBit = nil } - if err := unversioned.DeepCopy_unversioned_Duration(in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, c); err != nil { - return err - } + out.IPTablesSyncPeriod = in.IPTablesSyncPeriod out.KubeconfigPath = in.KubeconfigPath out.MasqueradeAll = in.MasqueradeAll out.Master = in.Master @@ -69,20 +64,14 @@ func DeepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *Ku out.Mode = in.Mode out.PortRange = in.PortRange out.ResourceContainer = in.ResourceContainer - if err := unversioned.DeepCopy_unversioned_Duration(in.UDPIdleTimeout, &out.UDPIdleTimeout, c); err != nil { - return err - } + out.UDPIdleTimeout = in.UDPIdleTimeout out.ConntrackMax = in.ConntrackMax - if err := unversioned.DeepCopy_unversioned_Duration(in.ConntrackTCPEstablishedTimeout, &out.ConntrackTCPEstablishedTimeout, c); err != nil { - return err - } + out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout return nil } func DeepCopy_v1alpha1_KubeSchedulerConfiguration(in KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Port = in.Port out.Address = in.Address out.AlgorithmProvider = in.AlgorithmProvider @@ -114,14 +103,8 @@ func DeepCopy_v1alpha1_LeaderElectionConfiguration(in LeaderElectionConfiguratio } else { out.LeaderElect = nil } - if err := unversioned.DeepCopy_unversioned_Duration(in.LeaseDuration, &out.LeaseDuration, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.RenewDeadline, &out.RenewDeadline, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Duration(in.RetryPeriod, &out.RetryPeriod, c); err != nil { - return err - } + out.LeaseDuration = in.LeaseDuration + out.RenewDeadline = in.RenewDeadline + out.RetryPeriod = in.RetryPeriod return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/defaults.go index bab6bb3e3..b40b3e463 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/doc.go index 65a03a209..621e80613 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/componentconfig + package v1alpha1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/register.go index d74effb7d..17fb52a10 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/types.go index 2ae65d87d..817468a70 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/deep_copy_generated.go index 118d478c2..d7bbf3bba 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package extensions import ( api "k8s.io/kubernetes/pkg/api" - resource "k8s.io/kubernetes/pkg/api/resource" unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" intstr "k8s.io/kubernetes/pkg/util/intstr" @@ -97,9 +96,7 @@ func DeepCopy_extensions_APIVersion(in APIVersion, out *APIVersion, c *conversio func DeepCopy_extensions_CustomMetricCurrentStatus(in CustomMetricCurrentStatus, out *CustomMetricCurrentStatus, c *conversion.Cloner) error { out.Name = in.Name - if err := resource.DeepCopy_resource_Quantity(in.CurrentValue, &out.CurrentValue, c); err != nil { - return err - } + out.CurrentValue = in.CurrentValue.DeepCopy() return nil } @@ -120,9 +117,7 @@ func DeepCopy_extensions_CustomMetricCurrentStatusList(in CustomMetricCurrentSta func DeepCopy_extensions_CustomMetricTarget(in CustomMetricTarget, out *CustomMetricTarget, c *conversion.Cloner) error { out.Name = in.Name - if err := resource.DeepCopy_resource_Quantity(in.TargetValue, &out.TargetValue, c); err != nil { - return err - } + out.TargetValue = in.TargetValue.DeepCopy() return nil } @@ -142,28 +137,20 @@ func DeepCopy_extensions_CustomMetricTargetList(in CustomMetricTargetList, out * } func DeepCopy_extensions_DaemonSet(in DaemonSet, out *DaemonSet, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_extensions_DaemonSetSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_extensions_DaemonSetStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_extensions_DaemonSetList(in DaemonSetList, out *DaemonSetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]DaemonSet, len(in)) @@ -202,28 +189,20 @@ func DeepCopy_extensions_DaemonSetStatus(in DaemonSetStatus, out *DaemonSetStatu } func DeepCopy_extensions_Deployment(in Deployment, out *Deployment, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_extensions_DeploymentSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_extensions_DeploymentStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_extensions_DeploymentList(in DeploymentList, out *DeploymentList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Deployment, len(in)) @@ -239,9 +218,7 @@ func DeepCopy_extensions_DeploymentList(in DeploymentList, out *DeploymentList, } func DeepCopy_extensions_DeploymentRollback(in DeploymentRollback, out *DeploymentRollback, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Name = in.Name if in.UpdatedAnnotations != nil { in, out := in.UpdatedAnnotations, &out.UpdatedAnnotations @@ -252,9 +229,7 @@ func DeepCopy_extensions_DeploymentRollback(in DeploymentRollback, out *Deployme } else { out.UpdatedAnnotations = nil } - if err := DeepCopy_extensions_RollbackConfig(in.RollbackTo, &out.RollbackTo, c); err != nil { - return err - } + out.RollbackTo = in.RollbackTo return nil } @@ -287,9 +262,7 @@ func DeepCopy_extensions_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, if in.RollbackTo != nil { in, out := in.RollbackTo, &out.RollbackTo *out = new(RollbackConfig) - if err := DeepCopy_extensions_RollbackConfig(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.RollbackTo = nil } @@ -310,9 +283,7 @@ func DeepCopy_extensions_DeploymentStrategy(in DeploymentStrategy, out *Deployme if in.RollingUpdate != nil { in, out := in.RollingUpdate, &out.RollingUpdate *out = new(RollingUpdateDeployment) - if err := DeepCopy_extensions_RollingUpdateDeployment(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.RollingUpdate = nil } @@ -325,9 +296,7 @@ func DeepCopy_extensions_FSGroupStrategyOptions(in FSGroupStrategyOptions, out * in, out := in.Ranges, &out.Ranges *out = make([]IDRange, len(in)) for i := range in { - if err := DeepCopy_extensions_IDRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ranges = nil @@ -337,9 +306,7 @@ func DeepCopy_extensions_FSGroupStrategyOptions(in FSGroupStrategyOptions, out * func DeepCopy_extensions_HTTPIngressPath(in HTTPIngressPath, out *HTTPIngressPath, c *conversion.Cloner) error { out.Path = in.Path - if err := DeepCopy_extensions_IngressBackend(in.Backend, &out.Backend, c); err != nil { - return err - } + out.Backend = in.Backend return nil } @@ -348,9 +315,7 @@ func DeepCopy_extensions_HTTPIngressRuleValue(in HTTPIngressRuleValue, out *HTTP in, out := in.Paths, &out.Paths *out = make([]HTTPIngressPath, len(in)) for i := range in { - if err := DeepCopy_extensions_HTTPIngressPath(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Paths = nil @@ -371,9 +336,7 @@ func DeepCopy_extensions_IDRange(in IDRange, out *IDRange, c *conversion.Cloner) } func DeepCopy_extensions_Ingress(in Ingress, out *Ingress, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -388,19 +351,13 @@ func DeepCopy_extensions_Ingress(in Ingress, out *Ingress, c *conversion.Cloner) func DeepCopy_extensions_IngressBackend(in IngressBackend, out *IngressBackend, c *conversion.Cloner) error { out.ServiceName = in.ServiceName - if err := intstr.DeepCopy_intstr_IntOrString(in.ServicePort, &out.ServicePort, c); err != nil { - return err - } + out.ServicePort = in.ServicePort return nil } func DeepCopy_extensions_IngressList(in IngressList, out *IngressList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Ingress, len(in)) @@ -440,9 +397,7 @@ func DeepCopy_extensions_IngressSpec(in IngressSpec, out *IngressSpec, c *conver if in.Backend != nil { in, out := in.Backend, &out.Backend *out = new(IngressBackend) - if err := DeepCopy_extensions_IngressBackend(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Backend = nil } @@ -491,9 +446,7 @@ func DeepCopy_extensions_IngressTLS(in IngressTLS, out *IngressTLS, c *conversio } func DeepCopy_extensions_NetworkPolicy(in NetworkPolicy, out *NetworkPolicy, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -530,12 +483,8 @@ func DeepCopy_extensions_NetworkPolicyIngressRule(in NetworkPolicyIngressRule, o } func DeepCopy_extensions_NetworkPolicyList(in NetworkPolicyList, out *NetworkPolicyList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]NetworkPolicy, len(in)) @@ -583,9 +532,7 @@ func DeepCopy_extensions_NetworkPolicyPort(in NetworkPolicyPort, out *NetworkPol if in.Port != nil { in, out := in.Port, &out.Port *out = new(intstr.IntOrString) - if err := intstr.DeepCopy_intstr_IntOrString(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Port = nil } @@ -611,9 +558,7 @@ func DeepCopy_extensions_NetworkPolicySpec(in NetworkPolicySpec, out *NetworkPol } func DeepCopy_extensions_PodSecurityPolicy(in PodSecurityPolicy, out *PodSecurityPolicy, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -624,12 +569,8 @@ func DeepCopy_extensions_PodSecurityPolicy(in PodSecurityPolicy, out *PodSecurit } func DeepCopy_extensions_PodSecurityPolicyList(in PodSecurityPolicyList, out *PodSecurityPolicyList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PodSecurityPolicy, len(in)) @@ -687,9 +628,7 @@ func DeepCopy_extensions_PodSecurityPolicySpec(in PodSecurityPolicySpec, out *Po in, out := in.HostPorts, &out.HostPorts *out = make([]HostPortRange, len(in)) for i := range in { - if err := DeepCopy_extensions_HostPortRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.HostPorts = nil @@ -713,28 +652,20 @@ func DeepCopy_extensions_PodSecurityPolicySpec(in PodSecurityPolicySpec, out *Po } func DeepCopy_extensions_ReplicaSet(in ReplicaSet, out *ReplicaSet, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_extensions_ReplicaSetSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_extensions_ReplicaSetStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_extensions_ReplicaSetList(in ReplicaSetList, out *ReplicaSetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ReplicaSet, len(in)) @@ -774,9 +705,7 @@ func DeepCopy_extensions_ReplicaSetStatus(in ReplicaSetStatus, out *ReplicaSetSt } func DeepCopy_extensions_ReplicationControllerDummy(in ReplicationControllerDummy, out *ReplicationControllerDummy, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta return nil } @@ -786,12 +715,8 @@ func DeepCopy_extensions_RollbackConfig(in RollbackConfig, out *RollbackConfig, } func DeepCopy_extensions_RollingUpdateDeployment(in RollingUpdateDeployment, out *RollingUpdateDeployment, c *conversion.Cloner) error { - if err := intstr.DeepCopy_intstr_IntOrString(in.MaxUnavailable, &out.MaxUnavailable, c); err != nil { - return err - } - if err := intstr.DeepCopy_intstr_IntOrString(in.MaxSurge, &out.MaxSurge, c); err != nil { - return err - } + out.MaxUnavailable = in.MaxUnavailable + out.MaxSurge = in.MaxSurge return nil } @@ -801,9 +726,7 @@ func DeepCopy_extensions_RunAsUserStrategyOptions(in RunAsUserStrategyOptions, o in, out := in.Ranges, &out.Ranges *out = make([]IDRange, len(in)) for i := range in { - if err := DeepCopy_extensions_IDRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ranges = nil @@ -816,9 +739,7 @@ func DeepCopy_extensions_SELinuxStrategyOptions(in SELinuxStrategyOptions, out * if in.SELinuxOptions != nil { in, out := in.SELinuxOptions, &out.SELinuxOptions *out = new(api.SELinuxOptions) - if err := api.DeepCopy_api_SELinuxOptions(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SELinuxOptions = nil } @@ -826,15 +747,11 @@ func DeepCopy_extensions_SELinuxStrategyOptions(in SELinuxStrategyOptions, out * } func DeepCopy_extensions_Scale(in Scale, out *Scale, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_extensions_ScaleSpec(in.Spec, &out.Spec, c); err != nil { - return err - } + out.Spec = in.Spec if err := DeepCopy_extensions_ScaleStatus(in.Status, &out.Status, c); err != nil { return err } @@ -866,9 +783,7 @@ func DeepCopy_extensions_SupplementalGroupsStrategyOptions(in SupplementalGroups in, out := in.Ranges, &out.Ranges *out = make([]IDRange, len(in)) for i := range in { - if err := DeepCopy_extensions_IDRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ranges = nil @@ -877,9 +792,7 @@ func DeepCopy_extensions_SupplementalGroupsStrategyOptions(in SupplementalGroups } func DeepCopy_extensions_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyResource, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -888,9 +801,7 @@ func DeepCopy_extensions_ThirdPartyResource(in ThirdPartyResource, out *ThirdPar in, out := in.Versions, &out.Versions *out = make([]APIVersion, len(in)) for i := range in { - if err := DeepCopy_extensions_APIVersion(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Versions = nil @@ -899,9 +810,7 @@ func DeepCopy_extensions_ThirdPartyResource(in ThirdPartyResource, out *ThirdPar } func DeepCopy_extensions_ThirdPartyResourceData(in ThirdPartyResourceData, out *ThirdPartyResourceData, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -916,12 +825,8 @@ func DeepCopy_extensions_ThirdPartyResourceData(in ThirdPartyResourceData, out * } func DeepCopy_extensions_ThirdPartyResourceDataList(in ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ThirdPartyResourceData, len(in)) @@ -937,12 +842,8 @@ func DeepCopy_extensions_ThirdPartyResourceDataList(in ThirdPartyResourceDataLis } func DeepCopy_extensions_ThirdPartyResourceList(in ThirdPartyResourceList, out *ThirdPartyResourceList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ThirdPartyResource, len(in)) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go new file mode 100644 index 000000000..2bbb71d05 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package extensions diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/install/install.go index 449127084..1279dfb1f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/register.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/register.go index 1c5f6ba10..48ba33d46 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.generated.go index eec90fb0a..fd982347a 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.go index 383719ca9..8c73db72e 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -51,7 +51,8 @@ type ScaleStatus struct { Selector *unversioned.LabelSelector `json:"selector,omitempty"` } -// +genclient=true,noMethods=true +// +genclient=true +// +noMethods=true // represents a scaling request for a resource. type Scale struct { @@ -94,7 +95,8 @@ type CustomMetricCurrentStatusList struct { Items []CustomMetricCurrentStatus `json:"items"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource // types to the API. It consists of one or more Versions of the api. @@ -624,7 +626,8 @@ type ReplicaSetStatus struct { ObservedGeneration int64 `json:"observedGeneration,omitempty"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // PodSecurityPolicy governs the ability to make requests that affect the SecurityContext // that will be applied to a pod and container. @@ -641,7 +644,7 @@ type PodSecurityPolicySpec struct { // Privileged determines if a pod can request to be run as privileged. Privileged bool `json:"privileged,omitempty"` // DefaultAddCapabilities is the default set of capabilities that will be added to the container - // unless the pod spec specifically drops the capability. You may not list a capabiility in both + // unless the pod spec specifically drops the capability. You may not list a capability in both // DefaultAddCapabilities and RequiredDropCapabilities. DefaultAddCapabilities []api.Capability `json:"defaultAddCapabilities,omitempty"` // RequiredDropCapabilities are the capabilities that will be dropped from the container. These diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go index ad5c91c90..d685ebfee 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go index 445394f16..6f4ff538b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -62,6 +62,8 @@ func init() { Convert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus, Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy, Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy, + Convert_v1beta1_ExportOptions_To_api_ExportOptions, + Convert_api_ExportOptions_To_v1beta1_ExportOptions, Convert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions, Convert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions, Convert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath, @@ -110,6 +112,8 @@ func init() { Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector, Convert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement, Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement, + Convert_v1beta1_ListOptions_To_api_ListOptions, + Convert_api_ListOptions_To_v1beta1_ListOptions, Convert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy, Convert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy, Convert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule, @@ -644,6 +648,32 @@ func autoConvert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in return nil } +func autoConvert_v1beta1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + out.Export = in.Export + out.Exact = in.Exact + return nil +} + +func Convert_v1beta1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error { + return autoConvert_v1beta1_ExportOptions_To_api_ExportOptions(in, out, s) +} + +func autoConvert_api_ExportOptions_To_v1beta1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + out.Export = in.Export + out.Exact = in.Exact + return nil +} + +func Convert_api_ExportOptions_To_v1beta1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error { + return autoConvert_api_ExportOptions_To_v1beta1_ExportOptions(in, out, s) +} + func autoConvert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions(in *FSGroupStrategyOptions, out *extensions.FSGroupStrategyOptions, s conversion.Scope) error { out.Rule = extensions.FSGroupStrategyType(in.Rule) if in.Ranges != nil { @@ -1440,6 +1470,46 @@ func Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequir return autoConvert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in, out, s) } +func autoConvert_v1beta1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := api.Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil { + return err + } + if err := api.Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil { + return err + } + out.Watch = in.Watch + out.ResourceVersion = in.ResourceVersion + out.TimeoutSeconds = in.TimeoutSeconds + return nil +} + +func Convert_v1beta1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error { + return autoConvert_v1beta1_ListOptions_To_api_ListOptions(in, out, s) +} + +func autoConvert_api_ListOptions_To_v1beta1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error { + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := api.Convert_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil { + return err + } + if err := api.Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil { + return err + } + out.Watch = in.Watch + out.ResourceVersion = in.ResourceVersion + out.TimeoutSeconds = in.TimeoutSeconds + return nil +} + +func Convert_api_ListOptions_To_v1beta1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error { + return autoConvert_api_ListOptions_To_v1beta1_ListOptions(in, out, s) +} + func autoConvert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy(in *NetworkPolicy, out *extensions.NetworkPolicy, s conversion.Scope) error { SetDefaults_NetworkPolicy(in) if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/deep_copy_generated.go index 32debd197..b7e43ed88 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package v1beta1 import ( api "k8s.io/kubernetes/pkg/api" - resource "k8s.io/kubernetes/pkg/api/resource" unversioned "k8s.io/kubernetes/pkg/api/unversioned" v1 "k8s.io/kubernetes/pkg/api/v1" conversion "k8s.io/kubernetes/pkg/conversion" @@ -118,9 +117,7 @@ func DeepCopy_v1beta1_CPUTargetUtilization(in CPUTargetUtilization, out *CPUTarg func DeepCopy_v1beta1_CustomMetricCurrentStatus(in CustomMetricCurrentStatus, out *CustomMetricCurrentStatus, c *conversion.Cloner) error { out.Name = in.Name - if err := resource.DeepCopy_resource_Quantity(in.CurrentValue, &out.CurrentValue, c); err != nil { - return err - } + out.CurrentValue = in.CurrentValue.DeepCopy() return nil } @@ -141,9 +138,7 @@ func DeepCopy_v1beta1_CustomMetricCurrentStatusList(in CustomMetricCurrentStatus func DeepCopy_v1beta1_CustomMetricTarget(in CustomMetricTarget, out *CustomMetricTarget, c *conversion.Cloner) error { out.Name = in.Name - if err := resource.DeepCopy_resource_Quantity(in.TargetValue, &out.TargetValue, c); err != nil { - return err - } + out.TargetValue = in.TargetValue.DeepCopy() return nil } @@ -163,28 +158,20 @@ func DeepCopy_v1beta1_CustomMetricTargetList(in CustomMetricTargetList, out *Cus } func DeepCopy_v1beta1_DaemonSet(in DaemonSet, out *DaemonSet, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1beta1_DaemonSetSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1beta1_DaemonSetStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_v1beta1_DaemonSetList(in DaemonSetList, out *DaemonSetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]DaemonSet, len(in)) @@ -223,28 +210,20 @@ func DeepCopy_v1beta1_DaemonSetStatus(in DaemonSetStatus, out *DaemonSetStatus, } func DeepCopy_v1beta1_Deployment(in Deployment, out *Deployment, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1beta1_DeploymentSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1beta1_DeploymentStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_v1beta1_DeploymentList(in DeploymentList, out *DeploymentList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Deployment, len(in)) @@ -260,9 +239,7 @@ func DeepCopy_v1beta1_DeploymentList(in DeploymentList, out *DeploymentList, c * } func DeepCopy_v1beta1_DeploymentRollback(in DeploymentRollback, out *DeploymentRollback, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Name = in.Name if in.UpdatedAnnotations != nil { in, out := in.UpdatedAnnotations, &out.UpdatedAnnotations @@ -273,9 +250,7 @@ func DeepCopy_v1beta1_DeploymentRollback(in DeploymentRollback, out *DeploymentR } else { out.UpdatedAnnotations = nil } - if err := DeepCopy_v1beta1_RollbackConfig(in.RollbackTo, &out.RollbackTo, c); err != nil { - return err - } + out.RollbackTo = in.RollbackTo return nil } @@ -314,9 +289,7 @@ func DeepCopy_v1beta1_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c * if in.RollbackTo != nil { in, out := in.RollbackTo, &out.RollbackTo *out = new(RollbackConfig) - if err := DeepCopy_v1beta1_RollbackConfig(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.RollbackTo = nil } @@ -347,9 +320,7 @@ func DeepCopy_v1beta1_DeploymentStrategy(in DeploymentStrategy, out *DeploymentS } func DeepCopy_v1beta1_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.Export = in.Export out.Exact = in.Exact return nil @@ -361,9 +332,7 @@ func DeepCopy_v1beta1_FSGroupStrategyOptions(in FSGroupStrategyOptions, out *FSG in, out := in.Ranges, &out.Ranges *out = make([]IDRange, len(in)) for i := range in { - if err := DeepCopy_v1beta1_IDRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ranges = nil @@ -373,9 +342,7 @@ func DeepCopy_v1beta1_FSGroupStrategyOptions(in FSGroupStrategyOptions, out *FSG func DeepCopy_v1beta1_HTTPIngressPath(in HTTPIngressPath, out *HTTPIngressPath, c *conversion.Cloner) error { out.Path = in.Path - if err := DeepCopy_v1beta1_IngressBackend(in.Backend, &out.Backend, c); err != nil { - return err - } + out.Backend = in.Backend return nil } @@ -384,9 +351,7 @@ func DeepCopy_v1beta1_HTTPIngressRuleValue(in HTTPIngressRuleValue, out *HTTPIng in, out := in.Paths, &out.Paths *out = make([]HTTPIngressPath, len(in)) for i := range in { - if err := DeepCopy_v1beta1_HTTPIngressPath(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Paths = nil @@ -395,9 +360,7 @@ func DeepCopy_v1beta1_HTTPIngressRuleValue(in HTTPIngressRuleValue, out *HTTPIng } func DeepCopy_v1beta1_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -411,12 +374,8 @@ func DeepCopy_v1beta1_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *H } func DeepCopy_v1beta1_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]HorizontalPodAutoscaler, len(in)) @@ -432,9 +391,7 @@ func DeepCopy_v1beta1_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList } func DeepCopy_v1beta1_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, c *conversion.Cloner) error { - if err := DeepCopy_v1beta1_SubresourceReference(in.ScaleRef, &out.ScaleRef, c); err != nil { - return err - } + out.ScaleRef = in.ScaleRef if in.MinReplicas != nil { in, out := in.MinReplicas, &out.MinReplicas *out = new(int32) @@ -446,9 +403,7 @@ func DeepCopy_v1beta1_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec if in.CPUUtilization != nil { in, out := in.CPUUtilization, &out.CPUUtilization *out = new(CPUTargetUtilization) - if err := DeepCopy_v1beta1_CPUTargetUtilization(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.CPUUtilization = nil } @@ -466,9 +421,7 @@ func DeepCopy_v1beta1_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerSt if in.LastScaleTime != nil { in, out := in.LastScaleTime, &out.LastScaleTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.LastScaleTime = nil } @@ -497,9 +450,7 @@ func DeepCopy_v1beta1_IDRange(in IDRange, out *IDRange, c *conversion.Cloner) er } func DeepCopy_v1beta1_Ingress(in Ingress, out *Ingress, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -514,19 +465,13 @@ func DeepCopy_v1beta1_Ingress(in Ingress, out *Ingress, c *conversion.Cloner) er func DeepCopy_v1beta1_IngressBackend(in IngressBackend, out *IngressBackend, c *conversion.Cloner) error { out.ServiceName = in.ServiceName - if err := intstr.DeepCopy_intstr_IntOrString(in.ServicePort, &out.ServicePort, c); err != nil { - return err - } + out.ServicePort = in.ServicePort return nil } func DeepCopy_v1beta1_IngressList(in IngressList, out *IngressList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Ingress, len(in)) @@ -566,9 +511,7 @@ func DeepCopy_v1beta1_IngressSpec(in IngressSpec, out *IngressSpec, c *conversio if in.Backend != nil { in, out := in.Backend, &out.Backend *out = new(IngressBackend) - if err := DeepCopy_v1beta1_IngressBackend(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Backend = nil } @@ -617,9 +560,7 @@ func DeepCopy_v1beta1_IngressTLS(in IngressTLS, out *IngressTLS, c *conversion.C } func DeepCopy_v1beta1_Job(in Job, out *Job, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -635,24 +576,16 @@ func DeepCopy_v1beta1_Job(in Job, out *Job, c *conversion.Cloner) error { func DeepCopy_v1beta1_JobCondition(in JobCondition, out *JobCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status - if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil { - return err - } + out.LastProbeTime = in.LastProbeTime.DeepCopy() + out.LastTransitionTime = in.LastTransitionTime.DeepCopy() out.Reason = in.Reason out.Message = in.Message return nil } func DeepCopy_v1beta1_JobList(in JobList, out *JobList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Job, len(in)) @@ -726,18 +659,14 @@ func DeepCopy_v1beta1_JobStatus(in JobStatus, out *JobStatus, c *conversion.Clon if in.StartTime != nil { in, out := in.StartTime, &out.StartTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.StartTime = nil } if in.CompletionTime != nil { in, out := in.CompletionTime, &out.CompletionTime *out = new(unversioned.Time) - if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil { - return err - } + **out = in.DeepCopy() } else { out.CompletionTime = nil } @@ -785,9 +714,7 @@ func DeepCopy_v1beta1_LabelSelectorRequirement(in LabelSelectorRequirement, out } func DeepCopy_v1beta1_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta out.LabelSelector = in.LabelSelector out.FieldSelector = in.FieldSelector out.Watch = in.Watch @@ -803,9 +730,7 @@ func DeepCopy_v1beta1_ListOptions(in ListOptions, out *ListOptions, c *conversio } func DeepCopy_v1beta1_NetworkPolicy(in NetworkPolicy, out *NetworkPolicy, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -842,12 +767,8 @@ func DeepCopy_v1beta1_NetworkPolicyIngressRule(in NetworkPolicyIngressRule, out } func DeepCopy_v1beta1_NetworkPolicyList(in NetworkPolicyList, out *NetworkPolicyList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]NetworkPolicy, len(in)) @@ -895,9 +816,7 @@ func DeepCopy_v1beta1_NetworkPolicyPort(in NetworkPolicyPort, out *NetworkPolicy if in.Port != nil { in, out := in.Port, &out.Port *out = new(intstr.IntOrString) - if err := intstr.DeepCopy_intstr_IntOrString(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.Port = nil } @@ -923,9 +842,7 @@ func DeepCopy_v1beta1_NetworkPolicySpec(in NetworkPolicySpec, out *NetworkPolicy } func DeepCopy_v1beta1_PodSecurityPolicy(in PodSecurityPolicy, out *PodSecurityPolicy, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -936,12 +853,8 @@ func DeepCopy_v1beta1_PodSecurityPolicy(in PodSecurityPolicy, out *PodSecurityPo } func DeepCopy_v1beta1_PodSecurityPolicyList(in PodSecurityPolicyList, out *PodSecurityPolicyList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PodSecurityPolicy, len(in)) @@ -999,9 +912,7 @@ func DeepCopy_v1beta1_PodSecurityPolicySpec(in PodSecurityPolicySpec, out *PodSe in, out := in.HostPorts, &out.HostPorts *out = make([]HostPortRange, len(in)) for i := range in { - if err := DeepCopy_v1beta1_HostPortRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.HostPorts = nil @@ -1025,28 +936,20 @@ func DeepCopy_v1beta1_PodSecurityPolicySpec(in PodSecurityPolicySpec, out *PodSe } func DeepCopy_v1beta1_ReplicaSet(in ReplicaSet, out *ReplicaSet, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1beta1_ReplicaSetSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1beta1_ReplicaSetStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_v1beta1_ReplicaSetList(in ReplicaSetList, out *ReplicaSetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ReplicaSet, len(in)) @@ -1092,9 +995,7 @@ func DeepCopy_v1beta1_ReplicaSetStatus(in ReplicaSetStatus, out *ReplicaSetStatu } func DeepCopy_v1beta1_ReplicationControllerDummy(in ReplicationControllerDummy, out *ReplicationControllerDummy, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta return nil } @@ -1107,18 +1008,14 @@ func DeepCopy_v1beta1_RollingUpdateDeployment(in RollingUpdateDeployment, out *R if in.MaxUnavailable != nil { in, out := in.MaxUnavailable, &out.MaxUnavailable *out = new(intstr.IntOrString) - if err := intstr.DeepCopy_intstr_IntOrString(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.MaxUnavailable = nil } if in.MaxSurge != nil { in, out := in.MaxSurge, &out.MaxSurge *out = new(intstr.IntOrString) - if err := intstr.DeepCopy_intstr_IntOrString(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.MaxSurge = nil } @@ -1131,9 +1028,7 @@ func DeepCopy_v1beta1_RunAsUserStrategyOptions(in RunAsUserStrategyOptions, out in, out := in.Ranges, &out.Ranges *out = make([]IDRange, len(in)) for i := range in { - if err := DeepCopy_v1beta1_IDRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ranges = nil @@ -1146,9 +1041,7 @@ func DeepCopy_v1beta1_SELinuxStrategyOptions(in SELinuxStrategyOptions, out *SEL if in.SELinuxOptions != nil { in, out := in.SELinuxOptions, &out.SELinuxOptions *out = new(v1.SELinuxOptions) - if err := v1.DeepCopy_v1_SELinuxOptions(*in, *out, c); err != nil { - return err - } + **out = *in } else { out.SELinuxOptions = nil } @@ -1156,15 +1049,11 @@ func DeepCopy_v1beta1_SELinuxStrategyOptions(in SELinuxStrategyOptions, out *SEL } func DeepCopy_v1beta1_Scale(in Scale, out *Scale, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_v1beta1_ScaleSpec(in.Spec, &out.Spec, c); err != nil { - return err - } + out.Spec = in.Spec if err := DeepCopy_v1beta1_ScaleStatus(in.Status, &out.Status, c); err != nil { return err } @@ -1205,9 +1094,7 @@ func DeepCopy_v1beta1_SupplementalGroupsStrategyOptions(in SupplementalGroupsStr in, out := in.Ranges, &out.Ranges *out = make([]IDRange, len(in)) for i := range in { - if err := DeepCopy_v1beta1_IDRange(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Ranges = nil @@ -1216,9 +1103,7 @@ func DeepCopy_v1beta1_SupplementalGroupsStrategyOptions(in SupplementalGroupsStr } func DeepCopy_v1beta1_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyResource, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -1227,9 +1112,7 @@ func DeepCopy_v1beta1_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyR in, out := in.Versions, &out.Versions *out = make([]APIVersion, len(in)) for i := range in { - if err := DeepCopy_v1beta1_APIVersion(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Versions = nil @@ -1238,9 +1121,7 @@ func DeepCopy_v1beta1_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyR } func DeepCopy_v1beta1_ThirdPartyResourceData(in ThirdPartyResourceData, out *ThirdPartyResourceData, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -1255,12 +1136,8 @@ func DeepCopy_v1beta1_ThirdPartyResourceData(in ThirdPartyResourceData, out *Thi } func DeepCopy_v1beta1_ThirdPartyResourceDataList(in ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ThirdPartyResourceData, len(in)) @@ -1276,12 +1153,8 @@ func DeepCopy_v1beta1_ThirdPartyResourceDataList(in ThirdPartyResourceDataList, } func DeepCopy_v1beta1_ThirdPartyResourceList(in ThirdPartyResourceList, out *ThirdPartyResourceList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ThirdPartyResource, len(in)) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/defaults.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/defaults.go index 71e55a467..ab6a202c3 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/defaults.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/defaults.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/doc.go index cfdb87c53..dc8790024 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/extensions +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/batch + package v1beta1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.pb.go index 3120ce17f..b58553320 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.proto index 2b639a9c7..46df0d6be 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/register.go index e8bbf28b1..91c1c4868 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.generated.go index cbe82eff3..a0220de07 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.go index c9e6167b0..55719fdba 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -46,7 +46,8 @@ type ScaleStatus struct { TargetSelector string `json:"targetSelector,omitempty" protobuf:"bytes,3,opt,name=targetSelector"` } -// +genclient=true,noMethods=true +// +genclient=true +// +noMethods=true // represents a scaling request for a resource. type Scale struct { @@ -166,7 +167,8 @@ type HorizontalPodAutoscalerList struct { Items []HorizontalPodAutoscaler `json:"items" protobuf:"bytes,2,rep,name=items"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource // types to the API. It consists of one or more Versions of the api. @@ -912,7 +914,8 @@ type ReplicaSetStatus struct { ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // Pod Security Policy governs the ability to make requests that affect the Security Context // that will be applied to a pod and container. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go index f8503f8db..182ff78c6 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/extensions/validation/validation.go b/vendor/k8s.io/kubernetes/pkg/apis/extensions/validation/validation.go index d0405c377..c13d747c8 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/extensions/validation/validation.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/extensions/validation/validation.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -147,18 +147,24 @@ var ValidateDeploymentName = apivalidation.NameIsDNSSubdomain func ValidatePositiveIntOrPercent(intOrPercent intstr.IntOrString, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - if intOrPercent.Type == intstr.String { - if !validation.IsValidPercent(intOrPercent.StrVal) { - allErrs = append(allErrs, field.Invalid(fldPath, intOrPercent, "must be an integer or percentage (e.g '5%')")) + switch intOrPercent.Type { + case intstr.String: + for _, msg := range validation.IsValidPercent(intOrPercent.StrVal) { + allErrs = append(allErrs, field.Invalid(fldPath, intOrPercent, msg)) } - } else if intOrPercent.Type == intstr.Int { + case intstr.Int: allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(intOrPercent.IntValue()), fldPath)...) + default: + allErrs = append(allErrs, field.Invalid(fldPath, intOrPercent, "must be an integer or percentage (e.g '5%%')")) } return allErrs } func getPercentValue(intOrStringValue intstr.IntOrString) (int, bool) { - if intOrStringValue.Type != intstr.String || !validation.IsValidPercent(intOrStringValue.StrVal) { + if intOrStringValue.Type != intstr.String { + return 0, false + } + if len(validation.IsValidPercent(intOrStringValue.StrVal)) != 0 { return 0, false } value, _ := strconv.Atoi(intOrStringValue.StrVal[:len(intOrStringValue.StrVal)-1]) @@ -422,16 +428,7 @@ func validateIngressBackend(backend *extensions.IngressBackend, fldPath *field.P allErrs = append(allErrs, field.Invalid(fldPath.Child("serviceName"), backend.ServiceName, msg)) } } - if backend.ServicePort.Type == intstr.String { - for _, msg := range validation.IsDNS1123Label(backend.ServicePort.StrVal) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("servicePort"), backend.ServicePort.StrVal, msg)) - } - if !validation.IsValidPortName(backend.ServicePort.StrVal) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("servicePort"), backend.ServicePort.StrVal, apivalidation.PortNameErrorMsg)) - } - } else if !validation.IsValidPortNum(backend.ServicePort.IntValue()) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("servicePort"), backend.ServicePort, apivalidation.PortRangeErrorMsg)) - } + allErrs = append(allErrs, apivalidation.ValidatePortNumOrName(backend.ServicePort, fldPath.Child("servicePort"))...) return allErrs } diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/deep_copy_generated.go index 390e4b4a7..098a0eed8 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import ( api "k8s.io/kubernetes/pkg/api" unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" - intstr "k8s.io/kubernetes/pkg/util/intstr" ) func init() { @@ -40,28 +39,20 @@ func init() { } func DeepCopy_policy_PodDisruptionBudget(in PodDisruptionBudget, out *PodDisruptionBudget, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_policy_PodDisruptionBudgetSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_policy_PodDisruptionBudgetStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_policy_PodDisruptionBudgetList(in PodDisruptionBudgetList, out *PodDisruptionBudgetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PodDisruptionBudget, len(in)) @@ -77,9 +68,7 @@ func DeepCopy_policy_PodDisruptionBudgetList(in PodDisruptionBudgetList, out *Po } func DeepCopy_policy_PodDisruptionBudgetSpec(in PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, c *conversion.Cloner) error { - if err := intstr.DeepCopy_intstr_IntOrString(in.MinAvailable, &out.MinAvailable, c); err != nil { - return err - } + out.MinAvailable = in.MinAvailable if in.Selector != nil { in, out := in.Selector, &out.Selector *out = new(unversioned.LabelSelector) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/doc.go new file mode 100644 index 000000000..876858cd9 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +package policy diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/install/install.go index 7882a0c53..90489a744 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/register.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/register.go index 76ea1a552..e61c82b28 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/types.generated.go index 08be370f1..06652687a 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/types.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/types.go index 2ecf41bcf..adc31e59f 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,7 +49,8 @@ type PodDisruptionBudgetStatus struct { ExpectedPods int32 `json:"expectedPods"` } -// +genclient=true,noMethods=true +// +genclient=true +// +noMethods=true // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/conversion_generated.go index 23aaa9a37..c524ca24a 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/deep_copy_generated.go index 74680aff8..05f286d09 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ import ( unversioned "k8s.io/kubernetes/pkg/api/unversioned" v1 "k8s.io/kubernetes/pkg/api/v1" conversion "k8s.io/kubernetes/pkg/conversion" - intstr "k8s.io/kubernetes/pkg/util/intstr" ) func init() { @@ -41,28 +40,20 @@ func init() { } func DeepCopy_v1alpha1_PodDisruptionBudget(in PodDisruptionBudget, out *PodDisruptionBudget, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1alpha1_PodDisruptionBudgetSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1alpha1_PodDisruptionBudgetStatus(in.Status, &out.Status, c); err != nil { - return err - } + out.Status = in.Status return nil } func DeepCopy_v1alpha1_PodDisruptionBudgetList(in PodDisruptionBudgetList, out *PodDisruptionBudgetList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PodDisruptionBudget, len(in)) @@ -78,9 +69,7 @@ func DeepCopy_v1alpha1_PodDisruptionBudgetList(in PodDisruptionBudgetList, out * } func DeepCopy_v1alpha1_PodDisruptionBudgetSpec(in PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, c *conversion.Cloner) error { - if err := intstr.DeepCopy_intstr_IntOrString(in.MinAvailable, &out.MinAvailable, c); err != nil { - return err - } + out.MinAvailable = in.MinAvailable if in.Selector != nil { in, out := in.Selector, &out.Selector *out = new(unversioned.LabelSelector) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/doc.go index 5cb716c29..985d4bbf0 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,8 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/policy + // Package policy is for any kind of policy object. Suitable examples, even if // they aren't all here, are PodDisruptionBudget, PodSecurityPolicy, // NetworkPolicy, etc. -// +genconversion=true package v1alpha1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.pb.go index 867a6b0a6..7a4c99901 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto index 866d0ae57..d04a0af8c 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/register.go index dd6c2dd14..6a82e3f9c 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -18,6 +18,7 @@ package v1alpha1 import ( "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/runtime" versionedwatch "k8s.io/kubernetes/pkg/watch/versioned" ) @@ -41,6 +42,8 @@ func addKnownTypes(scheme *runtime.Scheme) { scheme.AddKnownTypes(SchemeGroupVersion, &PodDisruptionBudget{}, &PodDisruptionBudgetList{}, + &v1.ListOptions{}, + &v1.DeleteOptions{}, ) // Add the watch version that applies versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.generated.go index 7ed4308bc..6592c9c31 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.go index 1f3265ae2..efe136fda 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -50,7 +50,8 @@ type PodDisruptionBudgetStatus struct { ExpectedPods int32 `json:"expectedPods" protobuf:"varint,4,opt,name=expectedPods"` } -// +genclient=true,noMethods=true +// +genclient=true +// +noMethods=true // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { diff --git a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go index 8ca1782f4..b12ce0fd2 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/deep_copy_generated.go index 5e9339a98..10d8c40f6 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package rbac import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" conversion "k8s.io/kubernetes/pkg/conversion" runtime "k8s.io/kubernetes/pkg/runtime" ) @@ -46,9 +45,7 @@ func init() { } func DeepCopy_rbac_ClusterRole(in ClusterRole, out *ClusterRole, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -67,9 +64,7 @@ func DeepCopy_rbac_ClusterRole(in ClusterRole, out *ClusterRole, c *conversion.C } func DeepCopy_rbac_ClusterRoleBinding(in ClusterRoleBinding, out *ClusterRoleBinding, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -77,26 +72,18 @@ func DeepCopy_rbac_ClusterRoleBinding(in ClusterRoleBinding, out *ClusterRoleBin in, out := in.Subjects, &out.Subjects *out = make([]Subject, len(in)) for i := range in { - if err := DeepCopy_rbac_Subject(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Subjects = nil } - if err := api.DeepCopy_api_ObjectReference(in.RoleRef, &out.RoleRef, c); err != nil { - return err - } + out.RoleRef = in.RoleRef return nil } func DeepCopy_rbac_ClusterRoleBindingList(in ClusterRoleBindingList, out *ClusterRoleBindingList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ClusterRoleBinding, len(in)) @@ -112,12 +99,8 @@ func DeepCopy_rbac_ClusterRoleBindingList(in ClusterRoleBindingList, out *Cluste } func DeepCopy_rbac_ClusterRoleList(in ClusterRoleList, out *ClusterRoleList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ClusterRole, len(in)) @@ -179,9 +162,7 @@ func DeepCopy_rbac_PolicyRule(in PolicyRule, out *PolicyRule, c *conversion.Clon } func DeepCopy_rbac_Role(in Role, out *Role, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -200,9 +181,7 @@ func DeepCopy_rbac_Role(in Role, out *Role, c *conversion.Cloner) error { } func DeepCopy_rbac_RoleBinding(in RoleBinding, out *RoleBinding, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -210,26 +189,18 @@ func DeepCopy_rbac_RoleBinding(in RoleBinding, out *RoleBinding, c *conversion.C in, out := in.Subjects, &out.Subjects *out = make([]Subject, len(in)) for i := range in { - if err := DeepCopy_rbac_Subject(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Subjects = nil } - if err := api.DeepCopy_api_ObjectReference(in.RoleRef, &out.RoleRef, c); err != nil { - return err - } + out.RoleRef = in.RoleRef return nil } func DeepCopy_rbac_RoleBindingList(in RoleBindingList, out *RoleBindingList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]RoleBinding, len(in)) @@ -245,12 +216,8 @@ func DeepCopy_rbac_RoleBindingList(in RoleBindingList, out *RoleBindingList, c * } func DeepCopy_rbac_RoleList(in RoleList, out *RoleList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Role, len(in)) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/doc.go index 15f91da2c..e4ce69b40 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:deepcopy-gen=package,register + // +groupName=rbac.authorization.k8s.io package rbac diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/install/install.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/install/install.go index 8cac247f4..0f6dc91b9 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/install/install.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/install/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/register.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/register.go index 58464d74d..5d89656e5 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/types.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/types.go index a35eb7db9..44a38971b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -126,7 +126,8 @@ type RoleList struct { Items []Role } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. type ClusterRole struct { @@ -138,7 +139,8 @@ type ClusterRole struct { Rules []PolicyRule } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/conversion_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/conversion_generated.go index f176aa090..558814677 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/conversion_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/conversion_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/deep_copy_generated.go index f898a434b..3f0e1eb36 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package v1alpha1 import ( api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" v1 "k8s.io/kubernetes/pkg/api/v1" conversion "k8s.io/kubernetes/pkg/conversion" runtime "k8s.io/kubernetes/pkg/runtime" @@ -47,9 +46,7 @@ func init() { } func DeepCopy_v1alpha1_ClusterRole(in ClusterRole, out *ClusterRole, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -68,9 +65,7 @@ func DeepCopy_v1alpha1_ClusterRole(in ClusterRole, out *ClusterRole, c *conversi } func DeepCopy_v1alpha1_ClusterRoleBinding(in ClusterRoleBinding, out *ClusterRoleBinding, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -78,26 +73,18 @@ func DeepCopy_v1alpha1_ClusterRoleBinding(in ClusterRoleBinding, out *ClusterRol in, out := in.Subjects, &out.Subjects *out = make([]Subject, len(in)) for i := range in { - if err := DeepCopy_v1alpha1_Subject(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Subjects = nil } - if err := v1.DeepCopy_v1_ObjectReference(in.RoleRef, &out.RoleRef, c); err != nil { - return err - } + out.RoleRef = in.RoleRef return nil } func DeepCopy_v1alpha1_ClusterRoleBindingList(in ClusterRoleBindingList, out *ClusterRoleBindingList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ClusterRoleBinding, len(in)) @@ -113,12 +100,8 @@ func DeepCopy_v1alpha1_ClusterRoleBindingList(in ClusterRoleBindingList, out *Cl } func DeepCopy_v1alpha1_ClusterRoleList(in ClusterRoleList, out *ClusterRoleList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ClusterRole, len(in)) @@ -176,9 +159,7 @@ func DeepCopy_v1alpha1_PolicyRule(in PolicyRule, out *PolicyRule, c *conversion. } func DeepCopy_v1alpha1_Role(in Role, out *Role, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -197,9 +178,7 @@ func DeepCopy_v1alpha1_Role(in Role, out *Role, c *conversion.Cloner) error { } func DeepCopy_v1alpha1_RoleBinding(in RoleBinding, out *RoleBinding, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } @@ -207,26 +186,18 @@ func DeepCopy_v1alpha1_RoleBinding(in RoleBinding, out *RoleBinding, c *conversi in, out := in.Subjects, &out.Subjects *out = make([]Subject, len(in)) for i := range in { - if err := DeepCopy_v1alpha1_Subject(in[i], &(*out)[i], c); err != nil { - return err - } + (*out)[i] = in[i] } } else { out.Subjects = nil } - if err := v1.DeepCopy_v1_ObjectReference(in.RoleRef, &out.RoleRef, c); err != nil { - return err - } + out.RoleRef = in.RoleRef return nil } func DeepCopy_v1alpha1_RoleBindingList(in RoleBindingList, out *RoleBindingList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]RoleBinding, len(in)) @@ -242,12 +213,8 @@ func DeepCopy_v1alpha1_RoleBindingList(in RoleBindingList, out *RoleBindingList, } func DeepCopy_v1alpha1_RoleList(in RoleList, out *RoleList, c *conversion.Cloner) error { - if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } - if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Role, len(in)) diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/doc.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/doc.go index 6873ebb10..e471bd384 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,5 +15,7 @@ limitations under the License. */ // +groupName=rbac.authorization.k8s.io -// +genconversion=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/rbac + package v1alpha1 diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.pb.go index 54b03ed15..fb917c356 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.proto b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.proto index 15c63b2f5..062f815b8 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/register.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/register.go index eadcb4fbd..cff47206b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.generated.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.generated.go index 58965dec0..bf7b3db2b 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.go index 52eacfe3f..a260facea 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -113,7 +113,8 @@ type RoleList struct { Items []Role `json:"items" protobuf:"bytes,2,rep,name=items"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. type ClusterRole struct { @@ -125,7 +126,8 @@ type ClusterRole struct { Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` } -// +genclient=true,nonNamespaced=true +// +genclient=true +// +nonNamespaced=true // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. diff --git a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go index b88c93c03..f1c6fdbdf 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/rbac/v1alpha1/types_swagger_doc_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/auth/user/doc.go b/vendor/k8s.io/kubernetes/pkg/auth/user/doc.go index b11258494..570c51ae9 100644 --- a/vendor/k8s.io/kubernetes/pkg/auth/user/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/auth/user/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/auth/user/user.go b/vendor/k8s.io/kubernetes/pkg/auth/user/user.go index c4a4c00d5..99261965d 100644 --- a/vendor/k8s.io/kubernetes/pkg/auth/user/user.go +++ b/vendor/k8s.io/kubernetes/pkg/auth/user/user.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/capabilities/capabilities.go b/vendor/k8s.io/kubernetes/pkg/capabilities/capabilities.go index d0a882c54..96146c6b0 100644 --- a/vendor/k8s.io/kubernetes/pkg/capabilities/capabilities.go +++ b/vendor/k8s.io/kubernetes/pkg/capabilities/capabilities.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -59,7 +59,7 @@ func Initialize(c Capabilities) { }) } -// Setup the capability set. It wraps Initialize for improving usibility. +// Setup the capability set. It wraps Initialize for improving usability. func Setup(allowPrivileged bool, privilegedSources PrivilegedSources, perConnectionBytesPerSec int64) { Initialize(Capabilities{ AllowPrivileged: allowPrivileged, diff --git a/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go b/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go index 81143a78e..b7fa14baa 100644 --- a/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/delta_fifo.go b/vendor/k8s.io/kubernetes/pkg/client/cache/delta_fifo.go index 3cb077faf..5a7f4a90f 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/delta_fifo.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/delta_fifo.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -228,15 +228,21 @@ func (f *DeltaFIFO) AddIfNotPresent(obj interface{}) error { } f.lock.Lock() defer f.lock.Unlock() + f.addIfNotPresent(id, deltas) + return nil +} + +// addIfNotPresent inserts deltas under id if it does not exist, and assumes the caller +// already holds the fifo lock. +func (f *DeltaFIFO) addIfNotPresent(id string, deltas Deltas) { f.populated = true if _, exists := f.items[id]; exists { - return nil + return } f.queue = append(f.queue, id) f.items[id] = deltas f.cond.Broadcast() - return nil } // re-listing and watching can deliver the same update multiple times in any @@ -387,7 +393,9 @@ func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err err // is returned, so if you don't successfully process it, you need to add it back // with AddIfNotPresent(). // process function is called under lock, so it is safe update data structures -// in it that need to be in sync with the queue (e.g. knownKeys). +// in it that need to be in sync with the queue (e.g. knownKeys). The PopProcessFunc +// may return an instance of ErrRequeue with a nested error to indicate the current +// item should be requeued (equivalent to calling AddIfNotPresent under the lock). // // Pop returns a 'Deltas', which has a complete list of all the things // that happened to the object (deltas) while it was sitting in the queue. @@ -409,9 +417,14 @@ func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) { continue } delete(f.items, id) + err := process(item) + if e, ok := err.(ErrRequeue); ok { + f.addIfNotPresent(id, item) + err = e.Err + } // Don't need to copyDeltas here, because we're transferring // ownership to the caller. - return item, process(item) + return item, err } } diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/doc.go b/vendor/k8s.io/kubernetes/pkg/client/cache/doc.go index 16600cf24..4f593f0d3 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache.go b/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache.go index ad8684e8c..8c5c4709d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache_fakes.go b/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache_fakes.go index 3b9597705..eb1d5353a 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache_fakes.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/expiration_cache_fakes.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/fake_custom_store.go b/vendor/k8s.io/kubernetes/pkg/client/cache/fake_custom_store.go index ccd69ef7b..8d71c2474 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/fake_custom_store.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/fake_custom_store.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/fifo.go b/vendor/k8s.io/kubernetes/pkg/client/cache/fifo.go index eaa35e62c..a6d5e0ab8 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/fifo.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/fifo.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -26,12 +26,28 @@ import ( // It is supposed to process the element popped from the queue. type PopProcessFunc func(interface{}) error +// ErrRequeue may be returned by a PopProcessFunc to safely requeue +// the current item. The value of Err will be returned from Pop. +type ErrRequeue struct { + // Err is returned by the Pop function + Err error +} + +func (e ErrRequeue) Error() string { + if e.Err == nil { + return "the popped item should be requeued without returning an error" + } + return e.Err.Error() +} + // Queue is exactly like a Store, but has a Pop() method too. type Queue interface { Store // Pop blocks until it has something to process. // It returns the object that was process and the result of processing. + // The PopProcessFunc may return an ErrRequeue{...} to indicate the item + // should be requeued before releasing the lock on the queue. Pop(PopProcessFunc) (interface{}, error) // AddIfNotPresent adds a value previously @@ -129,15 +145,21 @@ func (f *FIFO) AddIfNotPresent(obj interface{}) error { } f.lock.Lock() defer f.lock.Unlock() + f.addIfNotPresent(id, obj) + return nil +} + +// addIfNotPresent assumes the fifo lock is already held and adds the the provided +// item to the queue under id if it does not already exist. +func (f *FIFO) addIfNotPresent(id string, obj interface{}) { f.populated = true if _, exists := f.items[id]; exists { - return nil + return } f.queue = append(f.queue, id) f.items[id] = obj f.cond.Broadcast() - return nil } // Update is the same as Add in this implementation. @@ -224,7 +246,12 @@ func (f *FIFO) Pop(process PopProcessFunc) (interface{}, error) { continue } delete(f.items, id) - return item, process(item) + err := process(item) + if e, ok := err.(ErrRequeue); ok { + f.addIfNotPresent(id, item) + err = e.Err + } + return item, err } } diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/index.go b/vendor/k8s.io/kubernetes/pkg/client/cache/index.go index 572f2c06b..437988050 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/index.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/index.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/listers.go b/vendor/k8s.io/kubernetes/pkg/client/cache/listers.go index 1ba0be3a6..29e58597c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/listers.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/listers.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -122,7 +122,7 @@ func (s *StoreToPodLister) Exists(pod *api.Pod) (bool, error) { // NodeConditionPredicate is a function that indicates whether the given node's conditions meet // some set of criteria defined by the function. -type NodeConditionPredicate func(node api.Node) bool +type NodeConditionPredicate func(node *api.Node) bool // StoreToNodeLister makes a Store have the List method of the client.NodeInterface // The Store must contain (only) Nodes. @@ -153,9 +153,9 @@ type storeToNodeConditionLister struct { // List returns a list of nodes that match the conditions defined by the predicate functions in the storeToNodeConditionLister. func (s storeToNodeConditionLister) List() (nodes api.NodeList, err error) { for _, m := range s.store.List() { - node := *m.(*api.Node) + node := m.(*api.Node) if s.predicate(node) { - nodes.Items = append(nodes.Items, node) + nodes.Items = append(nodes.Items, *node) } else { glog.V(5).Infof("Node %s matches none of the conditions", node.Name) } @@ -582,7 +582,7 @@ func (s *StoreToPVFetcher) GetPersistentVolumeInfo(id string) (*api.PersistentVo } if !exists { - return nil, fmt.Errorf("PersistentVolume '%v' is not in cache", id) + return nil, fmt.Errorf("PersistentVolume '%v' not found", id) } return o.(*api.PersistentVolume), nil @@ -601,7 +601,7 @@ func (s *StoreToPVCFetcher) GetPersistentVolumeClaimInfo(namespace string, id st } if !exists { - return nil, fmt.Errorf("PersistentVolumeClaim '%s/%s' is not in cache", namespace, id) + return nil, fmt.Errorf("PersistentVolumeClaim '%s/%s' not found", namespace, id) } return o.(*api.PersistentVolumeClaim), nil diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/listwatch.go b/vendor/k8s.io/kubernetes/pkg/client/cache/listwatch.go index 06c2f611b..ff56c0b7b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/listwatch.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/listwatch.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/reflector.go b/vendor/k8s.io/kubernetes/pkg/client/cache/reflector.go index 3a5025a28..e1af63e05 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/reflector.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/reflector.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/store.go b/vendor/k8s.io/kubernetes/pkg/client/cache/store.go old mode 100644 new mode 100755 index 71115f2ce..4cd2479bd --- a/vendor/k8s.io/kubernetes/pkg/client/cache/store.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/store.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -99,7 +99,7 @@ func SplitMetaNamespaceKey(key string) (namespace, name string, err error) { // name only, no namespace return "", parts[0], nil case 2: - // name and namespace + // namespace and name return parts[0], parts[1], nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/thread_safe_store.go b/vendor/k8s.io/kubernetes/pkg/client/cache/thread_safe_store.go index 11077e25b..9d88ce33d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/thread_safe_store.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/thread_safe_store.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -261,12 +261,13 @@ func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) error { } index := c.indices[name] + if index == nil { + continue + } for _, indexValue := range indexValues { - if index != nil { - set := index[indexValue] - if set != nil { - set.Delete(key) - } + set := index[indexValue] + if set != nil { + set.Delete(key) } } } diff --git a/vendor/k8s.io/kubernetes/pkg/client/cache/undelta_store.go b/vendor/k8s.io/kubernetes/pkg/client/cache/undelta_store.go index 4a8a4500e..117df46c4 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/cache/undelta_store.go +++ b/vendor/k8s.io/kubernetes/pkg/client/cache/undelta_store.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/clientset.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/clientset.go index 9876441b7..010dd5303 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/clientset.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import ( "github.com/golang/glog" unversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned" unversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned" + unversionedcertificates "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned" unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned" unversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned" unversionedrbac "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned" @@ -35,6 +36,7 @@ type Interface interface { Autoscaling() unversionedautoscaling.AutoscalingInterface Batch() unversionedbatch.BatchInterface Rbac() unversionedrbac.RbacInterface + Certificates() unversionedcertificates.CertificatesInterface } // Clientset contains the clients for groups. Each group has exactly one @@ -46,6 +48,7 @@ type Clientset struct { *unversionedautoscaling.AutoscalingClient *unversionedbatch.BatchClient *unversionedrbac.RbacClient + *unversionedcertificates.CertificatesClient } // Core retrieves the CoreClient @@ -88,6 +91,14 @@ func (c *Clientset) Rbac() unversionedrbac.RbacInterface { return c.RbacClient } +// Certificates retrieves the CertificatesClient +func (c *Clientset) Certificates() unversionedcertificates.CertificatesInterface { + if c == nil { + return nil + } + return c.CertificatesClient +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { return c.DiscoveryClient @@ -103,30 +114,35 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) { var err error clientset.CoreClient, err = unversionedcore.NewForConfig(&configShallowCopy) if err != nil { - return &clientset, err + return nil, err } clientset.ExtensionsClient, err = unversionedextensions.NewForConfig(&configShallowCopy) if err != nil { - return &clientset, err + return nil, err } clientset.AutoscalingClient, err = unversionedautoscaling.NewForConfig(&configShallowCopy) if err != nil { - return &clientset, err + return nil, err } clientset.BatchClient, err = unversionedbatch.NewForConfig(&configShallowCopy) if err != nil { - return &clientset, err + return nil, err } clientset.RbacClient, err = unversionedrbac.NewForConfig(&configShallowCopy) if err != nil { - return &clientset, err + return nil, err + } + clientset.CertificatesClient, err = unversionedcertificates.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err } clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { glog.Errorf("failed to create the DiscoveryClient: %v", err) + return nil, err } - return &clientset, err + return &clientset, nil } // NewForConfigOrDie creates a new Clientset for the given config and @@ -138,6 +154,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset { clientset.AutoscalingClient = unversionedautoscaling.NewForConfigOrDie(c) clientset.BatchClient = unversionedbatch.NewForConfigOrDie(c) clientset.RbacClient = unversionedrbac.NewForConfigOrDie(c) + clientset.CertificatesClient = unversionedcertificates.NewForConfigOrDie(c) clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &clientset @@ -151,6 +168,7 @@ func New(c *restclient.RESTClient) *Clientset { clientset.AutoscalingClient = unversionedautoscaling.New(c) clientset.BatchClient = unversionedbatch.New(c) clientset.RbacClient = unversionedrbac.New(c) + clientset.CertificatesClient = unversionedcertificates.New(c) clientset.DiscoveryClient = discovery.NewDiscoveryClient(c) return &clientset diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/doc.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/doc.go index 3934caa42..cf081af2c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/import_known_versions.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/import_known_versions.go index 8bdbe2e6c..4a922df8a 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/import_known_versions.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/import_known_versions.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -26,6 +26,7 @@ import ( _ "k8s.io/kubernetes/pkg/apis/authorization/install" _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" _ "k8s.io/kubernetes/pkg/apis/batch/install" + _ "k8s.io/kubernetes/pkg/apis/certificates/install" _ "k8s.io/kubernetes/pkg/apis/componentconfig/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install" _ "k8s.io/kubernetes/pkg/apis/policy/install" diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/autoscaling_client.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/autoscaling_client.go index 752b5d554..71d01ff6d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/autoscaling_client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/doc.go index 47517b642..1e6a8ff82 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/generated_expansion.go index 39324902a..628b494c0 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/generated_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/horizontalpodautoscaler.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/horizontalpodautoscaler.go index ae185ad7f..747afc67a 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/horizontalpodautoscaler.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type HorizontalPodAutoscalerInterface interface { Get(name string) (*autoscaling.HorizontalPodAutoscaler, error) List(opts api.ListOptions) (*autoscaling.HorizontalPodAutoscalerList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *autoscaling.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } @@ -148,3 +149,16 @@ func (c *horizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched horizontalPodAutoscaler. +func (c *horizontalPodAutoscalers) Patch(name string, pt api.PatchType, data []byte) (result *autoscaling.HorizontalPodAutoscaler, err error) { + result = &autoscaling.HorizontalPodAutoscaler{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/batch_client.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/batch_client.go index 83d9d749c..8f2b0e803 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/batch_client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/doc.go index 47517b642..1e6a8ff82 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/generated_expansion.go index f876ef63f..a12d6f308 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/generated_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/job.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/job.go index 680c50654..b7031c28f 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/job.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/job.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type JobInterface interface { Get(name string) (*batch.Job, error) List(opts api.ListOptions) (*batch.JobList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *batch.Job, err error) JobExpansion } @@ -148,3 +149,16 @@ func (c *jobs) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched job. +func (c *jobs) Patch(name string, pt api.PatchType, data []byte) (result *batch.Job, err error) { + result = &batch.Job{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("jobs"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/scheduledjob.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/scheduledjob.go index 2675d11c4..9c6e59832 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/scheduledjob.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/scheduledjob.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type ScheduledJobInterface interface { Get(name string) (*batch.ScheduledJob, error) List(opts api.ListOptions) (*batch.ScheduledJobList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *batch.ScheduledJob, err error) ScheduledJobExpansion } @@ -148,3 +149,16 @@ func (c *scheduledJobs) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched scheduledJob. +func (c *scheduledJobs) Patch(name string, pt api.PatchType, data []byte) (result *batch.ScheduledJob, err error) { + result = &batch.ScheduledJob{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("scheduledjobs"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/certificates_client.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/certificates_client.go new file mode 100644 index 000000000..f1fdb4559 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/certificates_client.go @@ -0,0 +1,101 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +import ( + api "k8s.io/kubernetes/pkg/api" + registered "k8s.io/kubernetes/pkg/apimachinery/registered" + restclient "k8s.io/kubernetes/pkg/client/restclient" +) + +type CertificatesInterface interface { + GetRESTClient() *restclient.RESTClient + CertificateSigningRequestsGetter +} + +// CertificatesClient is used to interact with features provided by the Certificates group. +type CertificatesClient struct { + *restclient.RESTClient +} + +func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface { + return newCertificateSigningRequests(c) +} + +// NewForConfig creates a new CertificatesClient for the given config. +func NewForConfig(c *restclient.Config) (*CertificatesClient, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := restclient.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &CertificatesClient{client}, nil +} + +// NewForConfigOrDie creates a new CertificatesClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *restclient.Config) *CertificatesClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new CertificatesClient for the given RESTClient. +func New(c *restclient.RESTClient) *CertificatesClient { + return &CertificatesClient{c} +} + +func setConfigDefaults(config *restclient.Config) error { + // if certificates group is not registered, return an error + g, err := registered.Group("certificates") + if err != nil { + return err + } + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = restclient.DefaultKubernetesUserAgent() + } + // TODO: Unconditionally set the config.Version, until we fix the config. + //if config.Version == "" { + copyGroupVersion := g.GroupVersion + config.GroupVersion = ©GroupVersion + //} + + config.NegotiatedSerializer = api.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + return nil +} + +// GetRESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *CertificatesClient) GetRESTClient() *restclient.RESTClient { + if c == nil { + return nil + } + return c.RESTClient +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/certificatesigningrequest.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/certificatesigningrequest.go new file mode 100644 index 000000000..6ed157cc3 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/certificatesigningrequest.go @@ -0,0 +1,153 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +import ( + api "k8s.io/kubernetes/pkg/api" + certificates "k8s.io/kubernetes/pkg/apis/certificates" + watch "k8s.io/kubernetes/pkg/watch" +) + +// CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. +// A group's client should implement this interface. +type CertificateSigningRequestsGetter interface { + CertificateSigningRequests() CertificateSigningRequestInterface +} + +// CertificateSigningRequestInterface has methods to work with CertificateSigningRequest resources. +type CertificateSigningRequestInterface interface { + Create(*certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) + Update(*certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) + UpdateStatus(*certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) + Delete(name string, options *api.DeleteOptions) error + DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error + Get(name string) (*certificates.CertificateSigningRequest, error) + List(opts api.ListOptions) (*certificates.CertificateSigningRequestList, error) + Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *certificates.CertificateSigningRequest, err error) + CertificateSigningRequestExpansion +} + +// certificateSigningRequests implements CertificateSigningRequestInterface +type certificateSigningRequests struct { + client *CertificatesClient +} + +// newCertificateSigningRequests returns a CertificateSigningRequests +func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests { + return &certificateSigningRequests{ + client: c, + } +} + +// Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. +func (c *certificateSigningRequests) Create(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Post(). + Resource("certificatesigningrequests"). + Body(certificateSigningRequest). + Do(). + Into(result) + return +} + +// Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. +func (c *certificateSigningRequests) Update(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Put(). + Resource("certificatesigningrequests"). + Name(certificateSigningRequest.Name). + Body(certificateSigningRequest). + Do(). + Into(result) + return +} + +func (c *certificateSigningRequests) UpdateStatus(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Put(). + Resource("certificatesigningrequests"). + Name(certificateSigningRequest.Name). + SubResource("status"). + Body(certificateSigningRequest). + Do(). + Into(result) + return +} + +// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. +func (c *certificateSigningRequests) Delete(name string, options *api.DeleteOptions) error { + return c.client.Delete(). + Resource("certificatesigningrequests"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *certificateSigningRequests) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + return c.client.Delete(). + Resource("certificatesigningrequests"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. +func (c *certificateSigningRequests) Get(name string) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Get(). + Resource("certificatesigningrequests"). + Name(name). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. +func (c *certificateSigningRequests) List(opts api.ListOptions) (result *certificates.CertificateSigningRequestList, err error) { + result = &certificates.CertificateSigningRequestList{} + err = c.client.Get(). + Resource("certificatesigningrequests"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificateSigningRequests. +func (c *certificateSigningRequests) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Resource("certificatesigningrequests"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched certificateSigningRequest. +func (c *certificateSigningRequests) Patch(name string, pt api.PatchType, data []byte) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Patch(pt). + Resource("certificatesigningrequests"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/doc.go new file mode 100644 index 000000000..1e6a8ff82 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This package is generated by client-gen with the default arguments. + +// This package has the automatically generated typed clients. +package unversioned diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/generated_expansion.go new file mode 100644 index 000000000..fa61c9dbe --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned/generated_expansion.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +type CertificateSigningRequestExpansion interface{} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/componentstatus.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/componentstatus.go index 0ef0667da..014fd80b1 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/componentstatus.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type ComponentStatusInterface interface { Get(name string) (*api.ComponentStatus, error) List(opts api.ListOptions) (*api.ComponentStatusList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.ComponentStatus, err error) ComponentStatusExpansion } @@ -124,3 +125,15 @@ func (c *componentStatuses) Watch(opts api.ListOptions) (watch.Interface, error) VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched componentStatus. +func (c *componentStatuses) Patch(name string, pt api.PatchType, data []byte) (result *api.ComponentStatus, err error) { + result = &api.ComponentStatus{} + err = c.client.Patch(pt). + Resource("componentstatuses"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/configmap.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/configmap.go index b43e53d6c..9b24f8490 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/configmap.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type ConfigMapInterface interface { Get(name string) (*api.ConfigMap, error) List(opts api.ListOptions) (*api.ConfigMapList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.ConfigMap, err error) ConfigMapExpansion } @@ -133,3 +134,16 @@ func (c *configMaps) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched configMap. +func (c *configMaps) Patch(name string, pt api.PatchType, data []byte) (result *api.ConfigMap, err error) { + result = &api.ConfigMap{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("configmaps"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/core_client.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/core_client.go index 41aee4cf6..1e066dec9 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/core_client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/core_client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/doc.go index 47517b642..1e6a8ff82 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/endpoints.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/endpoints.go index 78e2a0878..ee96600c2 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/endpoints.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type EndpointsInterface interface { Get(name string) (*api.Endpoints, error) List(opts api.ListOptions) (*api.EndpointsList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Endpoints, err error) EndpointsExpansion } @@ -133,3 +134,16 @@ func (c *endpoints) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched endpoints. +func (c *endpoints) Patch(name string, pt api.PatchType, data []byte) (result *api.Endpoints, err error) { + result = &api.Endpoints{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("endpoints"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event.go index 5627690a6..f50a491d9 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type EventInterface interface { Get(name string) (*api.Event, error) List(opts api.ListOptions) (*api.EventList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Event, err error) EventExpansion } @@ -133,3 +134,16 @@ func (c *events) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched event. +func (c *events) Patch(name string, pt api.PatchType, data []byte) (result *api.Event, err error) { + result = &api.Event{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("events"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event_expansion.go index abdf89aa1..f3d6f468d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/event_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ type EventExpansion interface { CreateWithEventNamespace(event *api.Event) (*api.Event, error) // UpdateWithEventNamespace is the same as a Update, except that it sends the request to the event.Namespace. UpdateWithEventNamespace(event *api.Event) (*api.Event, error) - Patch(event *api.Event, data []byte) (*api.Event, error) + PatchWithEventNamespace(event *api.Event, data []byte) (*api.Event, error) // Search finds events about the specified object Search(objOrRef runtime.Object) (*api.EventList, error) // Returns the appropriate field selector based on the API version being used to communicate with the server. @@ -73,11 +73,15 @@ func (e *events) UpdateWithEventNamespace(event *api.Event) (*api.Event, error) return result, err } -// Patch modifies an existing event. It returns the copy of the event that the server returns, or an -// error. The namespace and name of the target event is deduced from the incompleteEvent. The -// namespace must either match this event client's namespace, or this event client must have been +// PatchWithEventNamespace modifies an existing event. It returns the copy of +// the event that the server returns, or an error. The namespace and name of the +// target event is deduced from the incompleteEvent. The namespace must either +// match this event client's namespace, or this event client must have been // created with the "" namespace. -func (e *events) Patch(incompleteEvent *api.Event, data []byte) (*api.Event, error) { +func (e *events) PatchWithEventNamespace(incompleteEvent *api.Event, data []byte) (*api.Event, error) { + if e.ns != "" && incompleteEvent.Namespace != e.ns { + return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", incompleteEvent.Namespace, e.ns) + } result := &api.Event{} err := e.client.Patch(api.StrategicMergePatchType). NamespaceIfScoped(incompleteEvent.Namespace, len(incompleteEvent.Namespace) > 0). @@ -153,5 +157,5 @@ func (e *EventSinkImpl) Update(event *api.Event) (*api.Event, error) { } func (e *EventSinkImpl) Patch(event *api.Event, data []byte) (*api.Event, error) { - return e.Interface.Patch(event, data) + return e.Interface.PatchWithEventNamespace(event, data) } diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/generated_expansion.go index 546f8e7a1..a61fba53a 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/generated_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/limitrange.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/limitrange.go index 86cc9b07f..7c65b0668 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/limitrange.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type LimitRangeInterface interface { Get(name string) (*api.LimitRange, error) List(opts api.ListOptions) (*api.LimitRangeList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.LimitRange, err error) LimitRangeExpansion } @@ -133,3 +134,16 @@ func (c *limitRanges) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched limitRange. +func (c *limitRanges) Patch(name string, pt api.PatchType, data []byte) (result *api.LimitRange, err error) { + result = &api.LimitRange{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("limitranges"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace.go index c1c8b4506..0f84a5a3e 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type NamespaceInterface interface { Get(name string) (*api.Namespace, error) List(opts api.ListOptions) (*api.NamespaceList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Namespace, err error) NamespaceExpansion } @@ -137,3 +138,15 @@ func (c *namespaces) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched namespace. +func (c *namespaces) Patch(name string, pt api.PatchType, data []byte) (result *api.Namespace, err error) { + result = &api.Namespace{} + err = c.client.Patch(pt). + Resource("namespaces"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace_expansion.go index 8f47aec48..15049da11 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/namespace_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node.go index b0c53ef1d..7f2ea1591 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type NodeInterface interface { Get(name string) (*api.Node, error) List(opts api.ListOptions) (*api.NodeList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Node, err error) NodeExpansion } @@ -137,3 +138,15 @@ func (c *nodes) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched node. +func (c *nodes) Patch(name string, pt api.PatchType, data []byte) (result *api.Node, err error) { + result = &api.Node{} + err = c.client.Patch(pt). + Resource("nodes"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node_expansion.go index 3146cdb35..767f157b8 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolume.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolume.go index 6b4d0f017..065df7c91 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolume.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type PersistentVolumeInterface interface { Get(name string) (*api.PersistentVolume, error) List(opts api.ListOptions) (*api.PersistentVolumeList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.PersistentVolume, err error) PersistentVolumeExpansion } @@ -137,3 +138,15 @@ func (c *persistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched persistentVolume. +func (c *persistentVolumes) Patch(name string, pt api.PatchType, data []byte) (result *api.PersistentVolume, err error) { + result = &api.PersistentVolume{} + err = c.client.Patch(pt). + Resource("persistentvolumes"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolumeclaim.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolumeclaim.go index 2f5b17437..d63402358 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolumeclaim.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type PersistentVolumeClaimInterface interface { Get(name string) (*api.PersistentVolumeClaim, error) List(opts api.ListOptions) (*api.PersistentVolumeClaimList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.PersistentVolumeClaim, err error) PersistentVolumeClaimExpansion } @@ -147,3 +148,16 @@ func (c *persistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, e VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched persistentVolumeClaim. +func (c *persistentVolumeClaims) Patch(name string, pt api.PatchType, data []byte) (result *api.PersistentVolumeClaim, err error) { + result = &api.PersistentVolumeClaim{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("persistentvolumeclaims"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod.go index 1cdfc8e71..630d3d4f5 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type PodInterface interface { Get(name string) (*api.Pod, error) List(opts api.ListOptions) (*api.PodList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Pod, err error) PodExpansion } @@ -147,3 +148,16 @@ func (c *pods) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched pod. +func (c *pods) Patch(name string, pt api.PatchType, data []byte) (result *api.Pod, err error) { + result = &api.Pod{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("pods"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod_expansion.go index 8ebd29d30..a72b84324 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/pod_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/podtemplate.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/podtemplate.go index cccef29f7..1999c4069 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/podtemplate.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type PodTemplateInterface interface { Get(name string) (*api.PodTemplate, error) List(opts api.ListOptions) (*api.PodTemplateList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.PodTemplate, err error) PodTemplateExpansion } @@ -133,3 +134,16 @@ func (c *podTemplates) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched podTemplate. +func (c *podTemplates) Patch(name string, pt api.PatchType, data []byte) (result *api.PodTemplate, err error) { + result = &api.PodTemplate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("podtemplates"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/replicationcontroller.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/replicationcontroller.go index 6f9f06625..fad85eb48 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/replicationcontroller.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type ReplicationControllerInterface interface { Get(name string) (*api.ReplicationController, error) List(opts api.ListOptions) (*api.ReplicationControllerList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.ReplicationController, err error) ReplicationControllerExpansion } @@ -147,3 +148,16 @@ func (c *replicationControllers) Watch(opts api.ListOptions) (watch.Interface, e VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched replicationController. +func (c *replicationControllers) Patch(name string, pt api.PatchType, data []byte) (result *api.ReplicationController, err error) { + result = &api.ReplicationController{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("replicationcontrollers"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/resourcequota.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/resourcequota.go index 2d0da73fb..d6a3fc581 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/resourcequota.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type ResourceQuotaInterface interface { Get(name string) (*api.ResourceQuota, error) List(opts api.ListOptions) (*api.ResourceQuotaList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.ResourceQuota, err error) ResourceQuotaExpansion } @@ -147,3 +148,16 @@ func (c *resourceQuotas) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched resourceQuota. +func (c *resourceQuotas) Patch(name string, pt api.PatchType, data []byte) (result *api.ResourceQuota, err error) { + result = &api.ResourceQuota{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("resourcequotas"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/secret.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/secret.go index 101fbdb54..e7a1f295b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/secret.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type SecretInterface interface { Get(name string) (*api.Secret, error) List(opts api.ListOptions) (*api.SecretList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Secret, err error) SecretExpansion } @@ -133,3 +134,16 @@ func (c *secrets) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched secret. +func (c *secrets) Patch(name string, pt api.PatchType, data []byte) (result *api.Secret, err error) { + result = &api.Secret{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("secrets"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service.go index 006f601c2..1d7b071e8 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type ServiceInterface interface { Get(name string) (*api.Service, error) List(opts api.ListOptions) (*api.ServiceList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.Service, err error) ServiceExpansion } @@ -147,3 +148,16 @@ func (c *services) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched service. +func (c *services) Patch(name string, pt api.PatchType, data []byte) (result *api.Service, err error) { + result = &api.Service{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("services"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service_expansion.go index 89266e6cd..de8f21c62 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/service_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/serviceaccount.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/serviceaccount.go index 65f7df263..43e1626d5 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/serviceaccount.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ type ServiceAccountInterface interface { Get(name string) (*api.ServiceAccount, error) List(opts api.ListOptions) (*api.ServiceAccountList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *api.ServiceAccount, err error) ServiceAccountExpansion } @@ -133,3 +134,16 @@ func (c *serviceAccounts) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched serviceAccount. +func (c *serviceAccounts) Patch(name string, pt api.PatchType, data []byte) (result *api.ServiceAccount, err error) { + result = &api.ServiceAccount{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("serviceaccounts"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/daemonset.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/daemonset.go index 96dae5835..8cc2e2e02 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/daemonset.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type DaemonSetInterface interface { Get(name string) (*extensions.DaemonSet, error) List(opts api.ListOptions) (*extensions.DaemonSetList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *extensions.DaemonSet, err error) DaemonSetExpansion } @@ -148,3 +149,16 @@ func (c *daemonSets) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched daemonSet. +func (c *daemonSets) Patch(name string, pt api.PatchType, data []byte) (result *extensions.DaemonSet, err error) { + result = &extensions.DaemonSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("daemonsets"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment.go index 3b995c021..66ac29a60 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type DeploymentInterface interface { Get(name string) (*extensions.Deployment, error) List(opts api.ListOptions) (*extensions.DeploymentList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *extensions.Deployment, err error) DeploymentExpansion } @@ -148,3 +149,16 @@ func (c *deployments) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched deployment. +func (c *deployments) Patch(name string, pt api.PatchType, data []byte) (result *extensions.Deployment, err error) { + result = &extensions.Deployment{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("deployments"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment_expansion.go index 9969aecc9..4d89330f8 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/deployment_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/doc.go index 47517b642..1e6a8ff82 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/extensions_client.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/extensions_client.go index 9b9f4749a..5454ea783 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/extensions_client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/extensions_client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/generated_expansion.go index 7a1999454..dd1ed2903 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/generated_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/ingress.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/ingress.go index a9d950eae..48f52996d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/ingress.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type IngressInterface interface { Get(name string) (*extensions.Ingress, error) List(opts api.ListOptions) (*extensions.IngressList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *extensions.Ingress, err error) IngressExpansion } @@ -148,3 +149,16 @@ func (c *ingresses) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched ingress. +func (c *ingresses) Patch(name string, pt api.PatchType, data []byte) (result *extensions.Ingress, err error) { + result = &extensions.Ingress{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("ingresses"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/job.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/job.go index 4ae3f6cac..f0411862b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/job.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/job.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/podsecuritypolicy.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/podsecuritypolicy.go index 06a7908f4..1ad64afe5 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/podsecuritypolicy.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type PodSecurityPolicyInterface interface { Get(name string) (*extensions.PodSecurityPolicy, error) List(opts api.ListOptions) (*extensions.PodSecurityPolicyList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *extensions.PodSecurityPolicy, err error) PodSecurityPolicyExpansion } @@ -125,3 +126,15 @@ func (c *podSecurityPolicies) Watch(opts api.ListOptions) (watch.Interface, erro VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched podSecurityPolicy. +func (c *podSecurityPolicies) Patch(name string, pt api.PatchType, data []byte) (result *extensions.PodSecurityPolicy, err error) { + result = &extensions.PodSecurityPolicy{} + err = c.client.Patch(pt). + Resource("podsecuritypolicies"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/replicaset.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/replicaset.go index 6257fd898..c8f47f9e7 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/replicaset.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ type ReplicaSetInterface interface { Get(name string) (*extensions.ReplicaSet, error) List(opts api.ListOptions) (*extensions.ReplicaSetList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *extensions.ReplicaSet, err error) ReplicaSetExpansion } @@ -148,3 +149,16 @@ func (c *replicaSets) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched replicaSet. +func (c *replicaSets) Patch(name string, pt api.PatchType, data []byte) (result *extensions.ReplicaSet, err error) { + result = &extensions.ReplicaSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("replicasets"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale.go index 7e54bc347..12455ca88 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale_expansion.go index 61a77f260..8dbba79e3 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/scale_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/thirdpartyresource.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/thirdpartyresource.go index a64ffb62c..4539d15dd 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/thirdpartyresource.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/thirdpartyresource.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type ThirdPartyResourceInterface interface { Get(name string) (*extensions.ThirdPartyResource, error) List(opts api.ListOptions) (*extensions.ThirdPartyResourceList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *extensions.ThirdPartyResource, err error) ThirdPartyResourceExpansion } @@ -125,3 +126,15 @@ func (c *thirdPartyResources) Watch(opts api.ListOptions) (watch.Interface, erro VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched thirdPartyResource. +func (c *thirdPartyResources) Patch(name string, pt api.PatchType, data []byte) (result *extensions.ThirdPartyResource, err error) { + result = &extensions.ThirdPartyResource{} + err = c.client.Patch(pt). + Resource("thirdpartyresources"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrole.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrole.go index 5d0b3912a..e8261651c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrole.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type ClusterRoleInterface interface { Get(name string) (*rbac.ClusterRole, error) List(opts api.ListOptions) (*rbac.ClusterRoleList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *rbac.ClusterRole, err error) ClusterRoleExpansion } @@ -125,3 +126,15 @@ func (c *clusterRoles) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched clusterRole. +func (c *clusterRoles) Patch(name string, pt api.PatchType, data []byte) (result *rbac.ClusterRole, err error) { + result = &rbac.ClusterRole{} + err = c.client.Patch(pt). + Resource("clusterroles"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrolebinding.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrolebinding.go index f2102592a..389464aee 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrolebinding.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type ClusterRoleBindingInterface interface { Get(name string) (*rbac.ClusterRoleBinding, error) List(opts api.ListOptions) (*rbac.ClusterRoleBindingList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *rbac.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } @@ -125,3 +126,15 @@ func (c *clusterRoleBindings) Watch(opts api.ListOptions) (watch.Interface, erro VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched clusterRoleBinding. +func (c *clusterRoleBindings) Patch(name string, pt api.PatchType, data []byte) (result *rbac.ClusterRoleBinding, err error) { + result = &rbac.ClusterRoleBinding{} + err = c.client.Patch(pt). + Resource("clusterrolebindings"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/doc.go index 47517b642..1e6a8ff82 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/generated_expansion.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/generated_expansion.go index a3b9c689d..cbb0192a1 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/generated_expansion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rbac_client.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rbac_client.go index 4d67337cd..fa2f336fe 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rbac_client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/role.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/role.go index 68e7ebe93..030244b11 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/role.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/role.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type RoleInterface interface { Get(name string) (*rbac.Role, error) List(opts api.ListOptions) (*rbac.RoleList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *rbac.Role, err error) RoleExpansion } @@ -134,3 +135,16 @@ func (c *roles) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched role. +func (c *roles) Patch(name string, pt api.PatchType, data []byte) (result *rbac.Role, err error) { + result = &rbac.Role{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("roles"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rolebinding.go b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rolebinding.go index c73318c97..a91beb592 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rolebinding.go +++ b/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ type RoleBindingInterface interface { Get(name string) (*rbac.RoleBinding, error) List(opts api.ListOptions) (*rbac.RoleBindingList, error) Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte) (result *rbac.RoleBinding, err error) RoleBindingExpansion } @@ -134,3 +135,16 @@ func (c *roleBindings) Watch(opts api.ListOptions) (watch.Interface, error) { VersionedParams(&opts, api.ParameterCodec). Watch() } + +// Patch applies the patch and returns the patched roleBinding. +func (c *roleBindings) Patch(name string, pt api.PatchType, data []byte) (result *rbac.RoleBinding, err error) { + result = &rbac.RoleBinding{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("rolebindings"). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/metrics/metrics.go b/vendor/k8s.io/kubernetes/pkg/client/metrics/metrics.go index efa66fc8b..53029b53e 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/metrics/metrics.go +++ b/vendor/k8s.io/kubernetes/pkg/client/metrics/metrics.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/record/doc.go b/vendor/k8s.io/kubernetes/pkg/client/record/doc.go index d95515432..0dc790696 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/record/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/record/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/record/event.go b/vendor/k8s.io/kubernetes/pkg/client/record/event.go index 47cbe3eca..903da6352 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/record/event.go +++ b/vendor/k8s.io/kubernetes/pkg/client/record/event.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/record/events_cache.go b/vendor/k8s.io/kubernetes/pkg/client/record/events_cache.go index fa76db795..3b08655a8 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/record/events_cache.go +++ b/vendor/k8s.io/kubernetes/pkg/client/record/events_cache.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/record/fake.go b/vendor/k8s.io/kubernetes/pkg/client/record/fake.go index 35204ef2d..e063a4fc6 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/record/fake.go +++ b/vendor/k8s.io/kubernetes/pkg/client/record/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/client.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/client.go index 230edd45c..24ad1914e 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/client.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -222,7 +222,3 @@ func (c *RESTClient) Delete() *Request { func (c *RESTClient) APIVersion() unversioned.GroupVersion { return *c.contentConfig.GroupVersion } - -func (c *RESTClient) Codec() runtime.Codec { - return c.contentConfig.Codec -} diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/config.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/config.go index 0741e3c2d..fec5f49a4 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/config.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/config.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,11 @@ import ( "k8s.io/kubernetes/pkg/version" ) +const ( + DefaultQPS float32 = 5.0 + DefaultBurst int = 10 +) + // Config holds the common attributes that can be passed to a Kubernetes client on // initialization. type Config struct { @@ -93,10 +98,12 @@ type Config struct { // on top of the returned RoundTripper. WrapTransport func(rt http.RoundTripper) http.RoundTripper - // QPS indicates the maximum QPS to the master from this client. If zero, QPS is unlimited. + // QPS indicates the maximum QPS to the master from this client. + // If it's zero, the created RESTClient will use DefaultQPS: 5 QPS float32 - // Maximum burst for throttle + // Maximum burst for throttle. + // If it's zero, the created RESTClient will use DefaultBurst: 10. Burst int // Rate limiter for limiting connections to the master from this client. If present overwrites QPS/Burst @@ -136,15 +143,6 @@ type ContentConfig struct { // NegotiatedSerializer is used for obtaining encoders and decoders for multiple // supported media types. NegotiatedSerializer runtime.NegotiatedSerializer - - // Codec specifies the encoding and decoding behavior for runtime.Objects passed - // to a RESTClient or Client. Required when initializing a RESTClient, optional - // when initializing a Client. - // - // DEPRECATED: Please use NegotiatedSerializer instead. - // Codec is currently used only in some tests and will be removed soon. - // All production setups should use NegotiatedSerializer. - Codec runtime.Codec } // RESTClientFor returns a RESTClient that satisfies the requested attributes on a client Config @@ -158,6 +156,14 @@ func RESTClientFor(config *Config) (*RESTClient, error) { if config.NegotiatedSerializer == nil { return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient") } + qps := config.QPS + if config.QPS == 0.0 { + qps = DefaultQPS + } + burst := config.Burst + if config.Burst == 0 { + burst = DefaultBurst + } baseURL, versionedAPIPath, err := defaultServerUrlFor(config) if err != nil { @@ -174,7 +180,7 @@ func RESTClientFor(config *Config) (*RESTClient, error) { httpClient = &http.Client{Transport: transport} } - return NewRESTClient(baseURL, versionedAPIPath, config.ContentConfig, config.QPS, config.Burst, config.RateLimiter, httpClient) + return NewRESTClient(baseURL, versionedAPIPath, config.ContentConfig, qps, burst, config.RateLimiter, httpClient) } // UnversionedRESTClientFor is the same as RESTClientFor, except that it allows @@ -214,12 +220,6 @@ func SetKubernetesDefaults(config *Config) error { if len(config.UserAgent) == 0 { config.UserAgent = DefaultKubernetesUserAgent() } - if config.QPS == 0.0 { - config.QPS = 5.0 - } - if config.Burst == 0 { - config.Burst = 10 - } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/plugin.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/plugin.go index 4752e375b..06ac3cce1 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/plugin.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/plugin.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/request.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/request.go index 9fd3f0ddb..51fac6bc9 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/request.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/request.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -573,7 +573,7 @@ func (r *Request) URL() *url.URL { if len(r.resource) != 0 { p = path.Join(p, strings.ToLower(r.resource)) } - // Join trims trailing slashes, so preserve r.pathPrefix's trailing slash for backwards compat if nothing was changed + // Join trims trailing slashes, so preserve r.pathPrefix's trailing slash for backwards compatibility if nothing was changed if len(r.resourceName) != 0 || len(r.subpath) != 0 || len(r.subresource) != 0 { p = path.Join(p, r.resourceName, r.subresource, r.subpath) } diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/transport.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/transport.go index 0bfa2ea27..c385914e2 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/transport.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/transport.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/url_utils.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/url_utils.go index 9a83d7874..81f16d63e 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/url_utils.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/url_utils.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ func DefaultServerURL(host, apiPath string, groupVersion unversioned.GroupVersio if err != nil { return nil, "", err } - if hostURL.Scheme == "" { + if hostURL.Scheme == "" || hostURL.Host == "" { scheme := "http://" if defaultTLS { scheme = "https://" diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/urlbackoff.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/urlbackoff.go index 6c672f08a..24a89ed97 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/urlbackoff.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/urlbackoff.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/restclient/versions.go b/vendor/k8s.io/kubernetes/pkg/client/restclient/versions.go index e12c05c10..337643447 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/restclient/versions.go +++ b/vendor/k8s.io/kubernetes/pkg/client/restclient/versions.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/transport/cache.go b/vendor/k8s.io/kubernetes/pkg/client/transport/cache.go index 8c07f5391..eedfd3d78 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/transport/cache.go +++ b/vendor/k8s.io/kubernetes/pkg/client/transport/cache.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/transport/config.go b/vendor/k8s.io/kubernetes/pkg/client/transport/config.go index 63a63fbb4..6e5c68a30 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/transport/config.go +++ b/vendor/k8s.io/kubernetes/pkg/client/transport/config.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/transport/round_trippers.go b/vendor/k8s.io/kubernetes/pkg/client/transport/round_trippers.go index 55284ebc6..aadf0cbf9 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/transport/round_trippers.go +++ b/vendor/k8s.io/kubernetes/pkg/client/transport/round_trippers.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/transport/transport.go b/vendor/k8s.io/kubernetes/pkg/client/transport/transport.go index 2d20e1b87..9c5b9ef3c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/transport/transport.go +++ b/vendor/k8s.io/kubernetes/pkg/client/transport/transport.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/typed/discovery/discovery_client.go b/vendor/k8s.io/kubernetes/pkg/client/typed/discovery/discovery_client.go index 283dd5a63..1bd18b954 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/typed/discovery/discovery_client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/typed/discovery/discovery_client.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -81,6 +81,8 @@ type SwaggerSchemaInterface interface { // versions and resources. type DiscoveryClient struct { *restclient.RESTClient + + LegacyPrefix string } // Convert unversioned.APIVersions to unversioned.APIGroup. APIVersions is used by legacy v1, so @@ -105,7 +107,7 @@ func apiVersionsToAPIGroup(apiVersions *unversioned.APIVersions) (apiGroup unver func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList, err error) { // Get the groupVersions exposed at /api v := &unversioned.APIVersions{} - err = d.Get().AbsPath("/api").Do().Into(v) + err = d.Get().AbsPath(d.LegacyPrefix).Do().Into(v) apiGroup := unversioned.APIGroup{} if err == nil { apiGroup = apiVersionsToAPIGroup(v) @@ -135,8 +137,9 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r url := url.URL{} if len(groupVersion) == 0 { return nil, fmt.Errorf("groupVersion shouldn't be empty") - } else if groupVersion == "v1" { - url.Path = "/api/" + groupVersion + } + if len(d.LegacyPrefix) > 0 && groupVersion == "v1" { + url.Path = d.LegacyPrefix + "/" + groupVersion } else { url.Path = "/apis/" + groupVersion } @@ -245,8 +248,8 @@ func (d *DiscoveryClient) SwaggerSchema(version unversioned.GroupVersion) (*swag return nil, fmt.Errorf("API version: %v is not supported by the server. Use one of: %v", version, groupVersions) } var path string - if version == v1.SchemeGroupVersion { - path = "/swaggerapi/api/" + version.Version + if len(d.LegacyPrefix) > 0 && version == v1.SchemeGroupVersion { + path = "/swaggerapi" + d.LegacyPrefix + "/" + version.Version } else { path = "/swaggerapi/apis/" + version.Group + "/" + version.Version } @@ -285,7 +288,7 @@ func NewDiscoveryClientForConfig(c *restclient.Config) (*DiscoveryClient, error) return nil, err } client, err := restclient.UnversionedRESTClientFor(&config) - return &DiscoveryClient{client}, err + return &DiscoveryClient{RESTClient: client, LegacyPrefix: "/api"}, err } // NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. If @@ -301,7 +304,7 @@ func NewDiscoveryClientForConfigOrDie(c *restclient.Config) *DiscoveryClient { // New creates a new DiscoveryClient for the given RESTClient. func NewDiscoveryClient(c *restclient.RESTClient) *DiscoveryClient { - return &DiscoveryClient{c} + return &DiscoveryClient{RESTClient: c, LegacyPrefix: "/api"} } func stringDoesntExistIn(str string, slice []string) bool { diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/adapters/internalclientset/clientset_adaption.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/adapters/internalclientset/clientset_adaption.go index 680cadc92..7e8f40a9b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/adapters/internalclientset/clientset_adaption.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/adapters/internalclientset/clientset_adaption.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package internalclientset import ( "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + unversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned" unversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned" unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned" unversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned" @@ -45,6 +46,11 @@ func FromUnversionedClient(c *unversioned.Client) *internalclientset.Clientset { } else { clientset.BatchClient = unversionedbatch.New(nil) } + if c != nil && c.AutoscalingClient != nil { + clientset.AutoscalingClient = unversionedautoscaling.New(c.AutoscalingClient.RESTClient) + } else { + clientset.AutoscalingClient = unversionedautoscaling.New(nil) + } if c != nil && c.DiscoveryClient != nil { clientset.DiscoveryClient = discovery.NewDiscoveryClient(c.DiscoveryClient.RESTClient) } else { diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/apps.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/apps.go index 1905c29c2..f2498cbb5 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/apps.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/apps.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -71,13 +71,6 @@ func setAppsDefaults(config *restclient.Config) error { config.GroupVersion = ©GroupVersion //} - config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/auth/clientauth.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/auth/clientauth.go index 64b3ef6be..128597f93 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/auth/clientauth.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/auth/clientauth.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/autoscaling.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/autoscaling.go index 9e543c9d3..188a5ea78 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/autoscaling.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/autoscaling.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -72,13 +72,6 @@ func setAutoscalingDefaults(config *restclient.Config) error { config.GroupVersion = ©GroupVersion //} - config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/batch.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/batch.go index 40fc49dc1..c31652f41 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/batch.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/batch.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -102,13 +102,6 @@ func setBatchDefaults(config *restclient.Config, gv *unversioned.GroupVersion) e config.GroupVersion = ©GroupVersion //} - config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/certificates.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/certificates.go new file mode 100644 index 000000000..29b15c45e --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/certificates.go @@ -0,0 +1,86 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apimachinery/registered" + "k8s.io/kubernetes/pkg/apis/certificates" + "k8s.io/kubernetes/pkg/client/restclient" +) + +// Interface holds the methods for clients of Kubernetes to allow mock testing. +type CertificatesInterface interface { + CertificateSigningRequests() CertificateSigningRequestInterface +} + +type CertificatesClient struct { + *restclient.RESTClient +} + +func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface { + return newCertificateSigningRequests(c) +} + +// NewCertificates creates a new CertificatesClient for the given config. +func NewCertificates(c *restclient.Config) (*CertificatesClient, error) { + config := *c + if err := setCertificatesDefaults(&config); err != nil { + return nil, err + } + client, err := restclient.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &CertificatesClient{client}, nil +} + +// NewCertificatesOrDie creates a new CertificatesClient for the given config and +// panics if there is an error in the config. +func NewCertificatesOrDie(c *restclient.Config) *CertificatesClient { + client, err := NewCertificates(c) + if err != nil { + panic(err) + } + return client +} + +func setCertificatesDefaults(config *restclient.Config) error { + // if certificates group is not registered, return an error + g, err := registered.Group(certificates.GroupName) + if err != nil { + return err + } + config.APIPath = defaultAPIPath + if config.UserAgent == "" { + config.UserAgent = restclient.DefaultKubernetesUserAgent() + } + // TODO: Unconditionally set the config.Version, until we fix the config. + //if config.Version == "" { + copyGroupVersion := g.GroupVersion + config.GroupVersion = ©GroupVersion + //} + + config.NegotiatedSerializer = api.Codecs + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + return nil +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/certificatesigningrequests.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/certificatesigningrequests.go new file mode 100644 index 000000000..f3ce09fc3 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/certificatesigningrequests.go @@ -0,0 +1,104 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/certificates" + "k8s.io/kubernetes/pkg/watch" +) + +// CertificateSigningRequestInterface has methods to work with CertificateSigningRequest resources. +type CertificateSigningRequestInterface interface { + List(opts api.ListOptions) (*certificates.CertificateSigningRequestList, error) + Get(name string) (*certificates.CertificateSigningRequest, error) + Delete(name string, options *api.DeleteOptions) error + Create(certificateSigningRequest *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) + Update(certificateSigningRequest *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) + UpdateStatus(certificateSigningRequest *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) + UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) + Watch(opts api.ListOptions) (watch.Interface, error) +} + +// certificateSigningRequests implements CertificateSigningRequestsNamespacer interface +type certificateSigningRequests struct { + client *CertificatesClient +} + +// newCertificateSigningRequests returns a certificateSigningRequests +func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests { + return &certificateSigningRequests{ + client: c, + } +} + +// List takes label and field selectors, and returns the list of certificateSigningRequests that match those selectors. +func (c *certificateSigningRequests) List(opts api.ListOptions) (result *certificates.CertificateSigningRequestList, err error) { + result = &certificates.CertificateSigningRequestList{} + err = c.client.Get().Resource("certificatesigningrequests").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) + return +} + +// Get takes the name of the certificateSigningRequest, and returns the corresponding CertificateSigningRequest object, and an error if it occurs +func (c *certificateSigningRequests) Get(name string) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Get().Resource("certificatesigningrequests").Name(name).Do().Into(result) + return +} + +// Delete takes the name of the certificateSigningRequest and deletes it. Returns an error if one occurs. +func (c *certificateSigningRequests) Delete(name string, options *api.DeleteOptions) error { + return c.client.Delete().Resource("certificatesigningrequests").Name(name).Body(options).Do().Error() +} + +// Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if it occurs. +func (c *certificateSigningRequests) Create(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Post().Resource("certificatesigningrequests").Body(certificateSigningRequest).Do().Into(result) + return +} + +// Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if it occurs. +func (c *certificateSigningRequests) Update(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Put().Resource("certificatesigningrequests").Name(certificateSigningRequest.Name).Body(certificateSigningRequest).Do().Into(result) + return +} + +// UpdateStatus takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if it occurs. +func (c *certificateSigningRequests) UpdateStatus(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Put().Resource("certificatesigningrequests").Name(certificateSigningRequest.Name).SubResource("status").Body(certificateSigningRequest).Do().Into(result) + return +} + +// UpdateApproval takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if it occurs. +func (c *certificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Put().Resource("certificatesigningrequests").Name(certificateSigningRequest.Name).SubResource("approval").Body(certificateSigningRequest).Do().Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificateSigningRequests. +func (c *certificateSigningRequests) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(api.NamespaceAll). + Resource("certificatesigningrequests"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/client.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/client.go index df6804004..5474e966f 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/client.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/client.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -49,6 +49,7 @@ type Interface interface { Extensions() ExtensionsInterface Rbac() RbacInterface Discovery() discovery.DiscoveryInterface + Certificates() CertificatesInterface } func (c *Client) ReplicationControllers(namespace string) ReplicationControllerInterface { @@ -124,6 +125,7 @@ type Client struct { *PolicyClient *RbacClient *discovery.DiscoveryClient + *CertificatesClient } // IsTimeout tests if this is a timeout error in the underlying transport. @@ -171,3 +173,7 @@ func (c *Client) Rbac() RbacInterface { func (c *Client) Discovery() discovery.DiscoveryInterface { return c.DiscoveryClient } + +func (c *Client) Certificates() CertificatesInterface { + return c.CertificatesClient +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/helpers.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/helpers.go index 87330c500..43e26487c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/helpers.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/helpers.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/latest/latest.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/latest/latest.go index 48cedb82e..0b9a4270c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/latest/latest.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/latest/latest.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/register.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/register.go index f26a6cd1b..5426e7fef 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/register.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/register.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/types.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/types.go index 56b44e8f4..95b5289f4 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/types.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/types.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/conversion.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/conversion.go index e03fc60b1..e22e5f81e 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/register.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/register.go index e5c9e88ef..dcdb533c0 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/register.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/types.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/types.go index 46b5dbaa7..77bce80a3 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/types.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/auth_loaders.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/auth_loaders.go index 8b10ce2bc..0abc425c0 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/auth_loaders.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/auth_loaders.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/client_config.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/client_config.go index c83f315a3..47b14e215 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/client_config.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/client_config.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/config.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/config.go index 049fc3921..9df69a741 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/config.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/config.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -22,6 +22,7 @@ import ( "path" "path/filepath" "reflect" + "sort" "github.com/golang/glog" @@ -153,6 +154,17 @@ func NewDefaultPathOptions() *PathOptions { // that means that this code will only write into a single file. If you want to relativizePaths, you must provide a fully qualified path in any // modified element. func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, relativizePaths bool) error { + possibleSources := configAccess.GetLoadingPrecedence() + // sort the possible kubeconfig files so we always "lock" in the same order + // to avoid deadlock (note: this can fail w/ symlinks, but... come on). + sort.Strings(possibleSources) + for _, filename := range possibleSources { + if err := lockFile(filename); err != nil { + return err + } + defer unlockFile(filename) + } + startingConfig, err := configAccess.GetStartingConfig() if err != nil { return err @@ -186,7 +198,10 @@ func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, rela destinationFile = configAccess.GetDefaultFilename() } - configToWrite := GetConfigFromFileOrDie(destinationFile) + configToWrite, err := getConfigFromFile(destinationFile) + if err != nil { + return err + } t := *cluster configToWrite.Clusters[key] = &t @@ -211,7 +226,10 @@ func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, rela destinationFile = configAccess.GetDefaultFilename() } - configToWrite := GetConfigFromFileOrDie(destinationFile) + configToWrite, err := getConfigFromFile(destinationFile) + if err != nil { + return err + } configToWrite.Contexts[key] = context if err := WriteToFile(*configToWrite, destinationFile); err != nil { @@ -228,7 +246,10 @@ func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, rela destinationFile = configAccess.GetDefaultFilename() } - configToWrite := GetConfigFromFileOrDie(destinationFile) + configToWrite, err := getConfigFromFile(destinationFile) + if err != nil { + return err + } t := *authInfo configToWrite.AuthInfos[key] = &t configToWrite.AuthInfos[key].LocationOfOrigin = destinationFile @@ -251,7 +272,10 @@ func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, rela destinationFile = configAccess.GetDefaultFilename() } - configToWrite := GetConfigFromFileOrDie(destinationFile) + configToWrite, err := getConfigFromFile(destinationFile) + if err != nil { + return err + } delete(configToWrite.Clusters, key) if err := WriteToFile(*configToWrite, destinationFile); err != nil { @@ -267,7 +291,10 @@ func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, rela destinationFile = configAccess.GetDefaultFilename() } - configToWrite := GetConfigFromFileOrDie(destinationFile) + configToWrite, err := getConfigFromFile(destinationFile) + if err != nil { + return err + } delete(configToWrite.Contexts, key) if err := WriteToFile(*configToWrite, destinationFile); err != nil { @@ -283,7 +310,10 @@ func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, rela destinationFile = configAccess.GetDefaultFilename() } - configToWrite := GetConfigFromFileOrDie(destinationFile) + configToWrite, err := getConfigFromFile(destinationFile) + if err != nil { + return err + } delete(configToWrite.AuthInfos, key) if err := WriteToFile(*configToWrite, destinationFile); err != nil { @@ -330,7 +360,10 @@ func writeCurrentContext(configAccess ConfigAccess, newCurrentContext string) er if configAccess.IsExplicitFile() { file := configAccess.GetExplicitFile() - currConfig := GetConfigFromFileOrDie(file) + currConfig, err := getConfigFromFile(file) + if err != nil { + return err + } currConfig.CurrentContext = newCurrentContext if err := WriteToFile(*currConfig, file); err != nil { return err @@ -341,7 +374,10 @@ func writeCurrentContext(configAccess ConfigAccess, newCurrentContext string) er if len(newCurrentContext) > 0 { destinationFile := configAccess.GetDefaultFilename() - config := GetConfigFromFileOrDie(destinationFile) + config, err := getConfigFromFile(destinationFile) + if err != nil { + return err + } config.CurrentContext = newCurrentContext if err := WriteToFile(*config, destinationFile); err != nil { @@ -354,7 +390,10 @@ func writeCurrentContext(configAccess ConfigAccess, newCurrentContext string) er // we're supposed to be clearing the current context. We need to find the first spot in the chain that is setting it and clear it for _, file := range configAccess.GetLoadingPrecedence() { if _, err := os.Stat(file); err == nil { - currConfig := GetConfigFromFileOrDie(file) + currConfig, err := getConfigFromFile(file) + if err != nil { + return err + } if len(currConfig.CurrentContext) > 0 { currConfig.CurrentContext = newCurrentContext @@ -379,7 +418,10 @@ func writePreferences(configAccess ConfigAccess, newPrefs clientcmdapi.Preferenc if configAccess.IsExplicitFile() { file := configAccess.GetExplicitFile() - currConfig := GetConfigFromFileOrDie(file) + currConfig, err := getConfigFromFile(file) + if err != nil { + return err + } currConfig.Preferences = newPrefs if err := WriteToFile(*currConfig, file); err != nil { return err @@ -389,7 +431,10 @@ func writePreferences(configAccess ConfigAccess, newPrefs clientcmdapi.Preferenc } for _, file := range configAccess.GetLoadingPrecedence() { - currConfig := GetConfigFromFileOrDie(file) + currConfig, err := getConfigFromFile(file) + if err != nil { + return err + } if !reflect.DeepEqual(currConfig.Preferences, newPrefs) { currConfig.Preferences = newPrefs @@ -404,15 +449,23 @@ func writePreferences(configAccess ConfigAccess, newPrefs clientcmdapi.Preferenc return errors.New("no config found to write preferences") } -// GetConfigFromFileOrDie tries to read a kubeconfig file and if it can't, it calls exit. One exception, missing files result in empty configs, not an exit -func GetConfigFromFileOrDie(filename string) *clientcmdapi.Config { +// getConfigFromFile tries to read a kubeconfig file and if it can't, returns an error. One exception, missing files result in empty configs, not an error. +func getConfigFromFile(filename string) (*clientcmdapi.Config, error) { config, err := LoadFromFile(filename) if err != nil && !os.IsNotExist(err) { - glog.FatalDepth(1, err) + return nil, err } - if config == nil { - return clientcmdapi.NewConfig() + config = clientcmdapi.NewConfig() + } + return config, nil +} + +// GetConfigFromFileOrDie tries to read a kubeconfig file and if it can't, it calls exit. One exception, missing files result in empty configs, not an exit +func GetConfigFromFileOrDie(filename string) *clientcmdapi.Config { + config, err := getConfigFromFile(filename) + if err != nil { + glog.FatalDepth(1, err) } return config diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/doc.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/doc.go index 7e8f9b4e3..30ef6f36d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go index f0c9c547a..100940622 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -230,14 +230,17 @@ func (rules *ClientConfigLoadingRules) Migrate() error { if _, err := os.Stat(destination); err == nil { // if the destination already exists, do nothing continue + } else if os.IsPermission(err) { + // if we can't access the file, skip it + continue } else if !os.IsNotExist(err) { // if we had an error other than non-existence, fail return err } if sourceInfo, err := os.Stat(source); err != nil { - if os.IsNotExist(err) { - // if the source file doesn't exist, there's no work to do. + if os.IsNotExist(err) || os.IsPermission(err) { + // if the source file doesn't exist or we can't access it, there's no work to do. continue } @@ -381,12 +384,40 @@ func WriteToFile(config clientcmdapi.Config, filename string) error { return err } } + if err := ioutil.WriteFile(filename, content, 0600); err != nil { return err } return nil } +func lockFile(filename string) error { + // TODO: find a way to do this with actual file locks. Will + // probably need seperate solution for windows and linux. + + // Make sure the dir exists before we try to create a lock file. + dir := filepath.Dir(filename) + if _, err := os.Stat(dir); os.IsNotExist(err) { + if err = os.MkdirAll(dir, 0755); err != nil { + return err + } + } + f, err := os.OpenFile(lockName(filename), os.O_CREATE|os.O_EXCL, 0) + if err != nil { + return err + } + f.Close() + return nil +} + +func unlockFile(filename string) error { + return os.Remove(lockName(filename)) +} + +func lockName(filename string) string { + return filename + ".lock" +} + // Write serializes the config to yaml. // Encapsulates serialization without assuming the destination is a file. func Write(config clientcmdapi.Config) ([]byte, error) { diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/merged_client_builder.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/merged_client_builder.go index 52c1493d0..018046912 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/merged_client_builder.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/merged_client_builder.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/overrides.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/overrides.go index f6dda97f1..40a35e65d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/overrides.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/overrides.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -124,12 +124,12 @@ const ( // RecommendedAuthOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing func RecommendedAuthOverrideFlags(prefix string) AuthOverrideFlags { return AuthOverrideFlags{ - ClientCertificate: FlagInfo{prefix + FlagCertFile, "", "", "Path to a client certificate file for TLS."}, - ClientKey: FlagInfo{prefix + FlagKeyFile, "", "", "Path to a client key file for TLS."}, - Token: FlagInfo{prefix + FlagBearerToken, "", "", "Bearer token for authentication to the API server."}, - Impersonate: FlagInfo{prefix + FlagImpersonate, "", "", "Username to impersonate for the operation."}, - Username: FlagInfo{prefix + FlagUsername, "", "", "Username for basic authentication to the API server."}, - Password: FlagInfo{prefix + FlagPassword, "", "", "Password for basic authentication to the API server."}, + ClientCertificate: FlagInfo{prefix + FlagCertFile, "", "", "Path to a client certificate file for TLS"}, + ClientKey: FlagInfo{prefix + FlagKeyFile, "", "", "Path to a client key file for TLS"}, + Token: FlagInfo{prefix + FlagBearerToken, "", "", "Bearer token for authentication to the API server"}, + Impersonate: FlagInfo{prefix + FlagImpersonate, "", "", "Username to impersonate for the operation"}, + Username: FlagInfo{prefix + FlagUsername, "", "", "Username for basic authentication to the API server"}, + Password: FlagInfo{prefix + FlagPassword, "", "", "Password for basic authentication to the API server"}, } } @@ -138,8 +138,8 @@ func RecommendedClusterOverrideFlags(prefix string) ClusterOverrideFlags { return ClusterOverrideFlags{ APIServer: FlagInfo{prefix + FlagAPIServer, "", "", "The address and port of the Kubernetes API server"}, APIVersion: FlagInfo{prefix + FlagAPIVersion, "", "", "DEPRECATED: The API version to use when talking to the server"}, - CertificateAuthority: FlagInfo{prefix + FlagCAFile, "", "", "Path to a cert. file for the certificate authority."}, - InsecureSkipTLSVerify: FlagInfo{prefix + FlagInsecure, "", "false", "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure."}, + CertificateAuthority: FlagInfo{prefix + FlagCAFile, "", "", "Path to a cert. file for the certificate authority"}, + InsecureSkipTLSVerify: FlagInfo{prefix + FlagInsecure, "", "false", "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure"}, } } @@ -158,7 +158,7 @@ func RecommendedContextOverrideFlags(prefix string) ContextOverrideFlags { return ContextOverrideFlags{ ClusterName: FlagInfo{prefix + FlagClusterName, "", "", "The name of the kubeconfig cluster to use"}, AuthInfoName: FlagInfo{prefix + FlagAuthInfoName, "", "", "The name of the kubeconfig user to use"}, - Namespace: FlagInfo{prefix + FlagNamespace, "", "", "If present, the namespace scope for this CLI request."}, + Namespace: FlagInfo{prefix + FlagNamespace, "", "", "If present, the namespace scope for this CLI request"}, } } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/validation.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/validation.go index 1690f515e..63f8adec6 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/validation.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/validation.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterrolebindings.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterrolebindings.go index 2a9d79846..fa9cad97d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterrolebindings.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterrolebindings.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterroles.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterroles.go index 0d2d375d6..165271ab5 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterroles.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/clusterroles.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/componentstatuses.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/componentstatuses.go index 0717cdec1..aca996b2b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/componentstatuses.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/componentstatuses.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/conditions.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/conditions.go index a61674e2b..5c284292b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/conditions.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/conditions.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -18,7 +18,6 @@ package unversioned import ( "fmt" - "time" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" @@ -29,61 +28,6 @@ import ( "k8s.io/kubernetes/pkg/watch" ) -// DefaultRetry is the recommended retry for a conflict where multiple clients -// are making changes to the same resource. -var DefaultRetry = wait.Backoff{ - Steps: 5, - Duration: 10 * time.Millisecond, - Factor: 1.0, - Jitter: 0.1, -} - -// DefaultBackoff is the recommended backoff for a conflict where a client -// may be attempting to make an unrelated modification to a resource under -// active management by one or more controllers. -var DefaultBackoff = wait.Backoff{ - Steps: 4, - Duration: 10 * time.Millisecond, - Factor: 5.0, - Jitter: 0.1, -} - -// RetryConflict executes the provided function repeatedly, retrying if the server returns a conflicting -// write. Callers should preserve previous executions if they wish to retry changes. It performs an -// exponential backoff. -// -// var pod *api.Pod -// err := RetryOnConflict(DefaultBackoff, func() (err error) { -// pod, err = c.Pods("mynamespace").UpdateStatus(podStatus) -// return -// }) -// if err != nil { -// // may be conflict if max retries were hit -// return err -// } -// ... -// -// TODO: Make Backoff an interface? -func RetryOnConflict(backoff wait.Backoff, fn func() error) error { - var lastConflictErr error - err := wait.ExponentialBackoff(backoff, func() (bool, error) { - err := fn() - switch { - case err == nil: - return true, nil - case errors.IsConflict(err): - lastConflictErr = err - return false, nil - default: - return false, err - } - }) - if err == wait.ErrWaitTimeout { - err = lastConflictErr - } - return err -} - // ControllerHasDesiredReplicas returns a condition that will be true if and only if // the desired replica count for a controller's ReplicaSelector equals the Replicas count. func ControllerHasDesiredReplicas(c Interface, controller *api.ReplicationController) wait.ConditionFunc { diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/configmap.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/configmap.go index 60fffa755..c2f20354f 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/configmap.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/containerinfo.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/containerinfo.go index 306386852..2f9aae8ab 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/containerinfo.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/containerinfo.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/daemon_sets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/daemon_sets.go index fa12591a6..7ec9182f8 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/daemon_sets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/daemon_sets.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/deployment.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/deployment.go index cafd4cfd1..a5e8afe94 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/deployment.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/doc.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/doc.go index 252d80975..dac3925b4 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/endpoints.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/endpoints.go index c58c88a28..6e20a347e 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/endpoints.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/events.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/events.go index b882ccdc4..3421bd811 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/events.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/events.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/extensions.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/extensions.go index 3c9114d9a..39b340877 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/extensions.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/extensions.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -126,13 +126,6 @@ func setExtensionsDefaults(config *restclient.Config) error { config.GroupVersion = ©GroupVersion //} - config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/flags.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/flags.go index 9fc540cfb..7d32a259d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/flags.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/flags.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/helper.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/helper.go index 020bb01c2..84757692d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/helper.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/helper.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -25,6 +25,7 @@ import ( "k8s.io/kubernetes/pkg/apis/apps" "k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/batch" + "k8s.io/kubernetes/pkg/apis/certificates" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/policy" "k8s.io/kubernetes/pkg/apis/rbac" @@ -95,6 +96,14 @@ func New(c *restclient.Config) (*Client, error) { return nil, err } } + var certsClient *CertificatesClient + if registered.IsRegistered(certificates.GroupName) { + certsConfig := *c + certsClient, err = NewCertificates(&certsConfig) + if err != nil { + return nil, err + } + } var appsClient *AppsClient if registered.IsRegistered(apps.GroupName) { @@ -114,7 +123,7 @@ func New(c *restclient.Config) (*Client, error) { } } - return &Client{RESTClient: client, AutoscalingClient: autoscalingClient, BatchClient: batchClient, ExtensionsClient: extensionsClient, DiscoveryClient: discoveryClient, AppsClient: appsClient, PolicyClient: policyClient, RbacClient: rbacClient}, nil + return &Client{RESTClient: client, AutoscalingClient: autoscalingClient, BatchClient: batchClient, CertificatesClient: certsClient, ExtensionsClient: extensionsClient, DiscoveryClient: discoveryClient, AppsClient: appsClient, PolicyClient: policyClient, RbacClient: rbacClient}, nil } // MatchesServerVersion queries the server to compares the build version @@ -134,7 +143,7 @@ func MatchesServerVersion(client *Client, c *restclient.Config) error { return fmt.Errorf("couldn't read version from server: %v\n", err) } // GitVersion includes GitCommit and GitTreeState, but best to be safe? - if cVer.GitVersion != sVer.GitVersion || cVer.GitCommit != sVer.GitCommit || cVer.GitTreeState != cVer.GitTreeState { + if cVer.GitVersion != sVer.GitVersion || cVer.GitCommit != sVer.GitCommit || cVer.GitTreeState != sVer.GitTreeState { return fmt.Errorf("server version (%#v) differs from client version (%#v)!\n", sVer, cVer) } @@ -193,6 +202,11 @@ func NegotiateVersion(client *Client, c *restclient.Config, requestedGV *unversi return nil, fmt.Errorf("client does not support API version %q; client supported API versions: %v", preferredGV, clientVersions) } + // If the server supports no versions, then we should just use the preferredGV + // This can happen because discovery fails due to 403 Forbidden errors + if len(serverVersions) == 0 { + return preferredGV, nil + } if serverVersions.Has(preferredGV.String()) { return preferredGV, nil } @@ -254,9 +268,6 @@ func SetKubernetesDefaults(config *restclient.Config) error { if config.NegotiatedSerializer == nil { config.NegotiatedSerializer = api.Codecs } - if config.Codec == nil { - config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) - } return restclient.SetKubernetesDefaults(config) } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/horizontalpodautoscaler.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/horizontalpodautoscaler.go index 8cdba3a26..76c6a9cf9 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/horizontalpodautoscaler.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/import_known_versions.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/import_known_versions.go index bbe61472d..8508573c0 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/import_known_versions.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/import_known_versions.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -27,6 +27,7 @@ import ( _ "k8s.io/kubernetes/pkg/apis/authorization/install" _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" _ "k8s.io/kubernetes/pkg/apis/batch/install" + _ "k8s.io/kubernetes/pkg/apis/certificates/install" _ "k8s.io/kubernetes/pkg/apis/componentconfig/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install" _ "k8s.io/kubernetes/pkg/apis/policy/install" diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/ingress.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/ingress.go index 4865b2086..59c6a6d9f 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/ingress.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/jobs.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/jobs.go index 94b819079..14cfa3a30 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/jobs.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/jobs.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/limit_ranges.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/limit_ranges.go index 8bc2253da..914a049f4 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/limit_ranges.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/limit_ranges.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/namespaces.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/namespaces.go index 122bcba50..b4a38361c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/namespaces.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/namespaces.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/network_policys.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/network_policys.go index 0dc9d97be..3e3f61045 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/network_policys.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/network_policys.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/nodes.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/nodes.go index 452a03f16..15a7db2ad 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/nodes.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/nodes.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -30,6 +30,7 @@ type NodeInterface interface { Create(node *api.Node) (*api.Node, error) List(opts api.ListOptions) (*api.NodeList, error) Delete(name string) error + DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error Update(*api.Node) (*api.Node, error) UpdateStatus(*api.Node) (*api.Node, error) Watch(opts api.ListOptions) (watch.Interface, error) @@ -76,6 +77,16 @@ func (c *nodes) Delete(name string) error { return c.r.Delete().Resource(c.resourceName()).Name(name).Do().Error() } +// DeleteCollection deletes a collection of nodes. +func (c *nodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + return c.r.Delete(). + Resource(c.resourceName()). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + // Update updates an existing node. func (c *nodes) Update(node *api.Node) (*api.Node, error) { result := &api.Node{} diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumeclaim.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumeclaim.go index bf5447d75..4ea3a95a7 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumeclaim.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumes.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumes.go index 2de17bb71..5fce1f0a4 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumes.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/persistentvolumes.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pet_sets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pet_sets.go index 71b1ea021..954efcd09 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pet_sets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pet_sets.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_disruption_budgets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_disruption_budgets.go index 14f373f37..0239623a7 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_disruption_budgets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_disruption_budgets.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_templates.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_templates.go index ed5b733c6..7627d735f 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_templates.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pod_templates.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pods.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pods.go index 426d3ee8e..ea16fb87d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/pods.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/pods.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/podsecuritypolicy.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/podsecuritypolicy.go index 356d913db..f03e643f2 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/podsecuritypolicy.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/policy.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/policy.go index 8b06ce275..9a47d7917 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/policy.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/policy.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -71,13 +71,6 @@ func setPolicyDefaults(config *restclient.Config) error { config.GroupVersion = ©GroupVersion //} - config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/rbac.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/rbac.go index 76ec392c3..09b2b4073 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/rbac.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/rbac.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -91,13 +91,6 @@ func setRbacDefaults(config *restclient.Config) error { config.GroupVersion = ©GroupVersion //} - config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/replica_sets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/replica_sets.go index be9284084..191a006b6 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/replica_sets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/replica_sets.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/replication_controllers.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/replication_controllers.go index f237a76ac..e4b9e2d99 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/replication_controllers.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/replication_controllers.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/resource_quotas.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/resource_quotas.go index acfd8ddb3..9944cef9b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/resource_quotas.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/resource_quotas.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/rolebindings.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/rolebindings.go index a43815c55..b79838010 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/rolebindings.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/rolebindings.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/roles.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/roles.go index 29aee1bae..b265e787b 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/roles.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/roles.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/scale.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/scale.go index 705f6048b..a55b0777d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/scale.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/scheduledjobs.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/scheduledjobs.go index d2b83fce2..de07a7e5d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/scheduledjobs.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/scheduledjobs.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/secrets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/secrets.go index 33d77ad24..bba3fd936 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/secrets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/secrets.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/service_accounts.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/service_accounts.go index d78a25c47..68d1b2112 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/service_accounts.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/service_accounts.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/services.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/services.go index 8b40a5d04..aada5c164 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/services.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/services.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/actions.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/actions.go index 1e5a5e470..15769e69d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/actions.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/actions.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_certificates.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_certificates.go new file mode 100644 index 000000000..6278decdf --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_certificates.go @@ -0,0 +1,107 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testclient + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/certificates" + "k8s.io/kubernetes/pkg/client/unversioned" + "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/watch" +) + +// NewSimpleFakeCertificate returns a client that will respond with the provided objects +func NewSimpleFakeCertificates(objects ...runtime.Object) *FakeCertificates { + return &FakeCertificates{Fake: NewSimpleFake(objects...)} +} + +// FakeCertificates implements CertificatesInterface. Meant to be +// embedded into a struct to get a default implementation. This makes faking +// out just the method you want to test easier. +type FakeCertificates struct { + *Fake +} + +func (c *FakeCertificates) CertificateSigningRequests() unversioned.CertificateSigningRequestInterface { + return &FakeCertificateSigningRequest{Fake: c} +} + +// FakeCertificateSigningRequest implements CertificateSigningRequestInterface +type FakeCertificateSigningRequest struct { + Fake *FakeCertificates +} + +func (c *FakeCertificateSigningRequest) Get(name string) (*certificates.CertificateSigningRequest, error) { + obj, err := c.Fake.Invokes(NewRootGetAction("certificatesigningrequests", name), &certificates.CertificateSigningRequest{}) + if obj == nil { + return nil, err + } + + return obj.(*certificates.CertificateSigningRequest), err +} + +func (c *FakeCertificateSigningRequest) List(opts api.ListOptions) (*certificates.CertificateSigningRequestList, error) { + obj, err := c.Fake.Invokes(NewRootListAction("certificatesigningrequests", opts), &certificates.CertificateSigningRequestList{}) + if obj == nil { + return nil, err + } + + return obj.(*certificates.CertificateSigningRequestList), err +} + +func (c *FakeCertificateSigningRequest) Create(csr *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) { + obj, err := c.Fake.Invokes(NewRootCreateAction("certificatesigningrequests", csr), csr) + if obj == nil { + return nil, err + } + + return obj.(*certificates.CertificateSigningRequest), err +} + +func (c *FakeCertificateSigningRequest) Update(csr *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) { + obj, err := c.Fake.Invokes(NewRootUpdateAction("certificatesigningrequests", csr), csr) + if obj == nil { + return nil, err + } + + return obj.(*certificates.CertificateSigningRequest), err +} + +func (c *FakeCertificateSigningRequest) UpdateStatus(csr *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) { + obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("certificatesigningrequests", "status", api.NamespaceAll, csr), csr) + if obj == nil { + return nil, err + } + return obj.(*certificates.CertificateSigningRequest), err +} + +func (c *FakeCertificateSigningRequest) UpdateApproval(csr *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) { + obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("certificatesigningrequests", "approval", api.NamespaceAll, csr), csr) + if obj == nil { + return nil, err + } + return obj.(*certificates.CertificateSigningRequest), err +} + +func (c *FakeCertificateSigningRequest) Delete(name string, opts *api.DeleteOptions) error { + _, err := c.Fake.Invokes(NewRootDeleteAction("certificatesigningrequests", name), &certificates.CertificateSigningRequest{}) + return err +} + +func (c *FakeCertificateSigningRequest) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewRootWatchAction("certificatesigningrequests", opts)) +} diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterrolebindings.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterrolebindings.go index 6da1da355..0e9d2413e 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterrolebindings.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterrolebindings.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterroles.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterroles.go index 5bdfd3dc7..5735224a7 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterroles.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_clusterroles.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_componentstatuses.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_componentstatuses.go index 34bf210d4..06bbdf8d2 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_componentstatuses.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_componentstatuses.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_configmaps.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_configmaps.go index 17a5bfeb8..7a35b28ab 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_configmaps.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_configmaps.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_daemon_sets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_daemon_sets.go index d0e1e73e1..ec0c88850 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_daemon_sets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_daemon_sets.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_deployments.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_deployments.go index 3e13fe7b3..7c4c10b30 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_deployments.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_deployments.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_endpoints.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_endpoints.go index 68f6178f7..dda3456af 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_endpoints.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_events.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_events.go index 3da2143fc..7c3ee3be6 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_events.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_events.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go index c299679f0..9c3805f8f 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_ingress.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_ingress.go index b15458997..da2b41115 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_ingress.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_jobs.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_jobs.go index dedde9dc3..bbcbdf662 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_jobs.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_jobs.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_limit_ranges.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_limit_ranges.go index 3669f5ff8..252093324 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_limit_ranges.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_limit_ranges.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_namespaces.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_namespaces.go index 8c4ac1ac2..45c924656 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_namespaces.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_namespaces.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_network_policies.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_network_policies.go index abbe9c61b..5239be9a1 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_network_policies.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_network_policies.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_nodes.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_nodes.go index b1943366e..d03882fb9 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_nodes.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_nodes.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -68,6 +68,11 @@ func (c *FakeNodes) Delete(name string) error { return err } +func (c *FakeNodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + _, err := c.Fake.Invokes(NewRootDeleteCollectionAction("nodes", listOptions), &api.NodeList{}) + return err +} + func (c *FakeNodes) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewRootWatchAction("nodes", opts)) } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go index cadfb084c..6eb092ff7 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volumes.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volumes.go index cb184bc44..d17d351f0 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volumes.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_persistent_volumes.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pod_templates.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pod_templates.go index 47ff3d8ac..83d746835 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pod_templates.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pod_templates.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pods.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pods.go index e634030c8..ef45382b7 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pods.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_pods.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_podsecuritypolicy.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_podsecuritypolicy.go index 06bd10991..33297b1a2 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_podsecuritypolicy.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replica_sets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replica_sets.go index 29c985c8c..174f9360d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replica_sets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replica_sets.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replication_controllers.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replication_controllers.go index e44b82615..2d3d7d9ef 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replication_controllers.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_replication_controllers.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_resource_quotas.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_resource_quotas.go index d5090f0d0..1bb062f4a 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_resource_quotas.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_resource_quotas.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_rolebindings.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_rolebindings.go index 6502cbd5a..d5e6bfc95 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_rolebindings.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_rolebindings.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_roles.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_roles.go index 53aeb1e27..bbbd795c5 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_roles.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_roles.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scales.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scales.go index 53ff5f87d..13050eb10 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scales.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scales.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scheduledjobs.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scheduledjobs.go index 7036682ba..60e866e6a 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scheduledjobs.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_scheduledjobs.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_secrets.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_secrets.go index f54cffb87..8ead395cb 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_secrets.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_secrets.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_service_accounts.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_service_accounts.go index e40641668..43dc3aaf5 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_service_accounts.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_service_accounts.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_services.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_services.go index fd4861ba1..158ad26ce 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_services.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_services.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_thirdpartyresources.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_thirdpartyresources.go index cb4a15572..db5a71850 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_thirdpartyresources.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fake_thirdpartyresources.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fixture.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fixture.go index 0fdbeac9f..6149f0a8d 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fixture.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/fixture.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/testclient.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/testclient.go index 96ff7d56b..d4f1eb70c 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/testclient.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/testclient/testclient.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -285,6 +285,10 @@ func (c *Fake) Batch() client.BatchInterface { return &FakeBatch{c} } +func (c *Fake) Certificates() client.CertificatesInterface { + return &FakeCertificates{c} +} + func (c *Fake) Extensions() client.ExtensionsInterface { return &FakeExperimental{c} } diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/thirdpartyresources.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/thirdpartyresources.go index 0908db06e..68adddbe7 100644 --- a/vendor/k8s.io/kubernetes/pkg/client/unversioned/thirdpartyresources.go +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/thirdpartyresources.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/client/unversioned/util.go b/vendor/k8s.io/kubernetes/pkg/client/unversioned/util.go new file mode 100644 index 000000000..9657ff2a9 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/client/unversioned/util.go @@ -0,0 +1,79 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +import ( + "time" + + "k8s.io/kubernetes/pkg/api/errors" + "k8s.io/kubernetes/pkg/util/wait" +) + +// DefaultRetry is the recommended retry for a conflict where multiple clients +// are making changes to the same resource. +var DefaultRetry = wait.Backoff{ + Steps: 5, + Duration: 10 * time.Millisecond, + Factor: 1.0, + Jitter: 0.1, +} + +// DefaultBackoff is the recommended backoff for a conflict where a client +// may be attempting to make an unrelated modification to a resource under +// active management by one or more controllers. +var DefaultBackoff = wait.Backoff{ + Steps: 4, + Duration: 10 * time.Millisecond, + Factor: 5.0, + Jitter: 0.1, +} + +// RetryConflict executes the provided function repeatedly, retrying if the server returns a conflicting +// write. Callers should preserve previous executions if they wish to retry changes. It performs an +// exponential backoff. +// +// var pod *api.Pod +// err := RetryOnConflict(DefaultBackoff, func() (err error) { +// pod, err = c.Pods("mynamespace").UpdateStatus(podStatus) +// return +// }) +// if err != nil { +// // may be conflict if max retries were hit +// return err +// } +// ... +// +// TODO: Make Backoff an interface? +func RetryOnConflict(backoff wait.Backoff, fn func() error) error { + var lastConflictErr error + err := wait.ExponentialBackoff(backoff, func() (bool, error) { + err := fn() + switch { + case err == nil: + return true, nil + case errors.IsConflict(err): + lastConflictErr = err + return false, nil + default: + return false, err + } + }) + if err == wait.ErrWaitTimeout { + err = lastConflictErr + } + return err +} diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/cloud.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/cloud.go index 0190ed50a..59cd18fa4 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/cloud.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/cloud.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/doc.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/doc.go index eaa91e6cf..7192394c3 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/plugins.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/plugins.go index ad39e3405..670400f62 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/plugins.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/plugins.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/doc.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/doc.go index 93acc5a31..25c79b9ec 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/gce.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/gce.go index d2cf415b5..589f2e001 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/gce.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/gce.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -38,7 +38,6 @@ import ( utilerrors "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/flowcontrol" netsets "k8s.io/kubernetes/pkg/util/net/sets" - "k8s.io/kubernetes/pkg/util/rand" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/wait" @@ -71,8 +70,8 @@ const ( // were to continuously return a nextPageToken. maxPages = 25 - // TargetPools can only support 1000 VMs. - maxInstancesPerTargetPool = 1000 + // Target Pool creation is limited to 200 instances. + maxTargetPoolCreateInstances = 200 ) // GCECloud is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine. @@ -124,14 +123,11 @@ type Disks interface { // GetAutoLabelsForPD returns labels to apply to PersistentVolume // representing this PD, namely failure domain and zone. - GetAutoLabelsForPD(name string) (map[string]string, error) + // zone can be provided to specify the zone for the PD, + // if empty all managed zones will be searched. + GetAutoLabelsForPD(name string, zone string) (map[string]string, error) } -type instRefSlice []*compute.InstanceReference - -func (p instRefSlice) Len() int { return len(p) } -func (p instRefSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - func init() { cloudprovider.RegisterCloudProvider(ProviderName, func(config io.Reader) (cloudprovider.Interface, error) { return newGCECloud(config) }) } @@ -546,7 +542,7 @@ func (gce *GCECloud) EnsureLoadBalancer(apiService *api.Service, hostNames []str affinityType := apiService.Spec.SessionAffinity serviceName := types.NamespacedName{Namespace: apiService.Namespace, Name: apiService.Name} - glog.V(2).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v, %v, %v)", loadBalancerName, gce.region, loadBalancerIP, portStr, hosts, serviceName, apiService.Annotations) + glog.V(2).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v, %v, %v)", loadBalancerName, gce.region, loadBalancerIP, portStr, hostNames, serviceName, apiService.Annotations) // Check if the forwarding rule exists, and if so, what its IP is. fwdRuleExists, fwdRuleNeedsUpdate, fwdRuleIP, err := gce.forwardingRuleNeedsUpdate(loadBalancerName, gce.region, loadBalancerIP, ports) @@ -715,10 +711,27 @@ func (gce *GCECloud) EnsureLoadBalancer(apiService *api.Service, hostNames []str // Once we've deleted the resources (if necessary), build them back up (or for // the first time if they're new). if tpNeedsUpdate { - if err := gce.createTargetPool(loadBalancerName, serviceName.String(), gce.region, hosts, affinityType); err != nil { + createInstances := hosts + if len(hosts) > maxTargetPoolCreateInstances { + createInstances = createInstances[:maxTargetPoolCreateInstances] + } + + if err := gce.createTargetPool(loadBalancerName, serviceName.String(), gce.region, createInstances, affinityType); err != nil { return nil, fmt.Errorf("failed to create target pool %s: %v", loadBalancerName, err) } - glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created target pool", loadBalancerName, serviceName) + if len(hosts) <= maxTargetPoolCreateInstances { + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created target pool", loadBalancerName, serviceName) + } else { + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created initial target pool (now updating with %d hosts)", loadBalancerName, serviceName, len(hosts)-maxTargetPoolCreateInstances) + + created := sets.NewString() + for _, host := range createInstances { + created.Insert(host.makeComparableHostPath()) + } + if err := gce.updateTargetPool(loadBalancerName, created, hosts); err != nil { + return nil, fmt.Errorf("failed to update target pool %s: %v", loadBalancerName, err) + } + } } if tpNeedsUpdate || fwdRuleNeedsUpdate { if err := gce.createForwardingRule(loadBalancerName, serviceName.String(), gce.region, ipAddress, ports); err != nil { @@ -907,22 +920,11 @@ func (gce *GCECloud) createForwardingRule(name, serviceName, region, ipAddress s return nil } -func restrictTargetPool(instances []string, max int) []string { - if len(instances) <= max { - return instances - } - rand.Shuffle(sort.StringSlice(instances)) - return instances[:max] -} - func (gce *GCECloud) createTargetPool(name, serviceName, region string, hosts []*gceInstance, affinityType api.ServiceAffinity) error { var instances []string for _, host := range hosts { instances = append(instances, makeHostURL(gce.projectID, host.Zone, host.Name)) } - // Choose a random subset of nodes to send traffic to, if we - // exceed API maximums. - instances = restrictTargetPool(instances, maxInstancesPerTargetPool) pool := &compute.TargetPool{ Name: name, Description: fmt.Sprintf(`{"kubernetes.io/service-name":"%s"}`, serviceName), @@ -1158,42 +1160,6 @@ func (gce *GCECloud) ensureStaticIP(name, serviceName, region, existingIP string return address.Address, existed, nil } -// computeUpdate takes the existing TargetPool and the set of running -// instances and returns (toAdd, toRemove), the set of instances to -// reprogram on the TargetPool this reconcile. max restricts the -// number of nodes allowed to be programmed on the TargetPool. -func computeUpdate(tp *compute.TargetPool, instances []*gceInstance, max int) ([]*compute.InstanceReference, []*compute.InstanceReference) { - existing := sets.NewString() - for _, instance := range tp.Instances { - existing.Insert(hostURLToComparablePath(instance)) - } - - var toAdd []*compute.InstanceReference - var toRemove []*compute.InstanceReference - for _, host := range instances { - link := host.makeComparableHostPath() - if !existing.Has(link) { - toAdd = append(toAdd, &compute.InstanceReference{Instance: link}) - } - existing.Delete(link) - } - for link := range existing { - toRemove = append(toRemove, &compute.InstanceReference{Instance: link}) - } - - if len(tp.Instances)+len(toAdd)-len(toRemove) > max { - // TODO(zmerlynn): In theory, there are faster ways to handle - // this if room is much smaller than len(toAdd). In practice, - // meh. - room := max - len(tp.Instances) + len(toRemove) - glog.Infof("TargetPool maximums exceeded, shuffling in %d instances", room) - rand.Shuffle(instRefSlice(toAdd)) - toAdd = toAdd[:room] - } - - return toAdd, toRemove -} - // UpdateLoadBalancer is an implementation of LoadBalancer.UpdateLoadBalancer. func (gce *GCECloud) UpdateLoadBalancer(service *api.Service, hostNames []string) error { hosts, err := gce.getInstancesByNames(hostNames) @@ -1206,11 +1172,31 @@ func (gce *GCECloud) UpdateLoadBalancer(service *api.Service, hostNames []string if err != nil { return err } + existing := sets.NewString() + for _, instance := range pool.Instances { + existing.Insert(hostURLToComparablePath(instance)) + } - toAdd, toRemove := computeUpdate(pool, hosts, maxInstancesPerTargetPool) - if len(toRemove) > 0 { - rm := &compute.TargetPoolsRemoveInstanceRequest{Instances: toRemove} - op, err := gce.service.TargetPools.RemoveInstance(gce.projectID, gce.region, loadBalancerName, rm).Do() + return gce.updateTargetPool(loadBalancerName, existing, hosts) +} + +func (gce *GCECloud) updateTargetPool(loadBalancerName string, existing sets.String, hosts []*gceInstance) error { + var toAdd []*compute.InstanceReference + var toRemove []*compute.InstanceReference + for _, host := range hosts { + link := host.makeComparableHostPath() + if !existing.Has(link) { + toAdd = append(toAdd, &compute.InstanceReference{Instance: link}) + } + existing.Delete(link) + } + for link := range existing { + toRemove = append(toRemove, &compute.InstanceReference{Instance: link}) + } + + if len(toAdd) > 0 { + add := &compute.TargetPoolsAddInstanceRequest{Instances: toAdd} + op, err := gce.service.TargetPools.AddInstance(gce.projectID, gce.region, loadBalancerName, add).Do() if err != nil { return err } @@ -1219,9 +1205,9 @@ func (gce *GCECloud) UpdateLoadBalancer(service *api.Service, hostNames []string } } - if len(toAdd) > 0 { - add := &compute.TargetPoolsAddInstanceRequest{Instances: toAdd} - op, err := gce.service.TargetPools.AddInstance(gce.projectID, gce.region, loadBalancerName, add).Do() + if len(toRemove) > 0 { + rm := &compute.TargetPoolsRemoveInstanceRequest{Instances: toRemove} + op, err := gce.service.TargetPools.RemoveInstance(gce.projectID, gce.region, loadBalancerName, rm).Do() if err != nil { return err } @@ -1237,14 +1223,10 @@ func (gce *GCECloud) UpdateLoadBalancer(service *api.Service, hostNames []string if err != nil { return err } - wantInstances := len(hosts) - if wantInstances > maxInstancesPerTargetPool { - wantInstances = maxInstancesPerTargetPool - } - if len(updatedPool.Instances) != wantInstances { + if len(updatedPool.Instances) != len(hosts) { glog.Errorf("Unexpected number of instances (%d) in target pool %s after updating (expected %d). Instances in updated pool: %s", - len(updatedPool.Instances), loadBalancerName, wantInstances, strings.Join(updatedPool.Instances, ",")) - return fmt.Errorf("Unexpected number of instances (%d) in target pool %s after update (expected %d)", len(updatedPool.Instances), loadBalancerName, wantInstances) + len(updatedPool.Instances), loadBalancerName, len(hosts), strings.Join(updatedPool.Instances, ",")) + return fmt.Errorf("Unexpected number of instances (%d) in target pool %s after update (expected %d)", len(updatedPool.Instances), loadBalancerName, len(hosts)) } return nil } @@ -2089,6 +2071,48 @@ func (gce *GCECloud) List(filter string) ([]string, error) { return instances, nil } +// GetAllZones returns all the zones in which nodes are running +func (gce *GCECloud) GetAllZones() (sets.String, error) { + // Fast-path for non-multizone + if len(gce.managedZones) == 1 { + return sets.NewString(gce.managedZones...), nil + } + + // TODO: Caching, but this is currently only called when we are creating a volume, + // which is a relatively infrequent operation, and this is only # zones API calls + zones := sets.NewString() + + // TODO: Parallelize, although O(zones) so not too bad (N <= 3 typically) + for _, zone := range gce.managedZones { + // We only retrieve one page in each zone - we only care about existence + listCall := gce.service.Instances.List(gce.projectID, zone) + + // No filter: We assume that a zone is either used or unused + // We could only consider running nodes (like we do in List above), + // but probably if instances are starting we still want to consider them. + // I think we should wait until we have a reason to make the + // call one way or the other; we generally can't guarantee correct + // volume spreading if the set of zones is changing + // (and volume spreading is currently only a heuristic). + // Long term we want to replace GetAllZones (which primarily supports volume + // spreading) with a scheduler policy that is able to see the global state of + // volumes and the health of zones. + + // Just a minimal set of fields - we only care about existence + listCall = listCall.Fields("items(name)") + + res, err := listCall.Do() + if err != nil { + return nil, err + } + if len(res.Items) != 0 { + zones.Insert(zone) + } + } + + return zones, nil +} + func getMetadataValue(metadata *compute.Metadata, key string) (string, bool) { for _, item := range metadata.Items { if item.Key == key { @@ -2241,13 +2265,33 @@ func (gce *GCECloud) DeleteDisk(diskToDelete string) error { // Builds the labels that should be automatically added to a PersistentVolume backed by a GCE PD // Specifically, this builds FailureDomain (zone) and Region labels. // The PersistentVolumeLabel admission controller calls this and adds the labels when a PV is created. -func (gce *GCECloud) GetAutoLabelsForPD(name string) (map[string]string, error) { - disk, err := gce.getDiskByNameUnknownZone(name) - if err != nil { - return nil, err +// If zone is specified, the volume will only be found in the specified zone, +// otherwise all managed zones will be searched. +func (gce *GCECloud) GetAutoLabelsForPD(name string, zone string) (map[string]string, error) { + var disk *gceDisk + var err error + if zone == "" { + // We would like as far as possible to avoid this case, + // because GCE doesn't guarantee that volumes are uniquely named per region, + // just per zone. However, creation of GCE PDs was originally done only + // by name, so we have to continue to support that. + // However, wherever possible the zone should be passed (and it is passed + // for most cases that we can control, e.g. dynamic volume provisioning) + disk, err = gce.getDiskByNameUnknownZone(name) + if err != nil { + return nil, err + } + zone = disk.Zone + } else { + // We could assume the disks exists; we have all the information we need + // However it is more consistent to ensure the disk exists, + // and in future we may gather addition information (e.g. disk type, IOPS etc) + disk, err = gce.getDiskByName(name, zone) + if err != nil { + return nil, err + } } - zone := disk.Zone region, err := GetGCERegion(zone) if err != nil { return nil, err diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/token_source.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/token_source.go index 20028c02c..a30cae577 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/token_source.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/token_source.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go b/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go index a7aba40be..c4f5c2894 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -40,8 +40,6 @@ import ( ) const ( - CreatedByAnnotation = "kubernetes.io/created-by" - // If a watch drops a delete event for a pod, it'll take this long // before a dormant controller waiting for those packets is woken up anyway. It is // specifically targeted at the case where some problem prevents an update @@ -392,7 +390,7 @@ func getPodsAnnotationSet(template *api.PodTemplateSpec, object runtime.Object) if err != nil { return desiredAnnotations, fmt.Errorf("unable to serialize controller reference: %v", err) } - desiredAnnotations[CreatedByAnnotation] = string(createdByRefJson) + desiredAnnotations[api.CreatedByAnnotation] = string(createdByRefJson) return desiredAnnotations, nil } @@ -525,6 +523,43 @@ func (f *FakePodControl) Clear() { f.Templates = []api.PodTemplateSpec{} } +// ByLogging allows custom sorting of pods so the best one can be picked for getting its logs. +type ByLogging []*api.Pod + +func (s ByLogging) Len() int { return len(s) } +func (s ByLogging) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +func (s ByLogging) Less(i, j int) bool { + // 1. assigned < unassigned + if s[i].Spec.NodeName != s[j].Spec.NodeName && (len(s[i].Spec.NodeName) == 0 || len(s[j].Spec.NodeName) == 0) { + return len(s[i].Spec.NodeName) > 0 + } + // 2. PodRunning < PodUnknown < PodPending + m := map[api.PodPhase]int{api.PodRunning: 0, api.PodUnknown: 1, api.PodPending: 2} + if m[s[i].Status.Phase] != m[s[j].Status.Phase] { + return m[s[i].Status.Phase] < m[s[j].Status.Phase] + } + // 3. ready < not ready + if api.IsPodReady(s[i]) != api.IsPodReady(s[j]) { + return api.IsPodReady(s[i]) + } + // TODO: take availability into account when we push minReadySeconds information from deployment into pods, + // see https://github.com/kubernetes/kubernetes/issues/22065 + // 4. Been ready for more time < less time < empty time + if api.IsPodReady(s[i]) && api.IsPodReady(s[j]) && !podReadyTime(s[i]).Equal(podReadyTime(s[j])) { + return afterOrZero(podReadyTime(s[j]), podReadyTime(s[i])) + } + // 5. Pods with containers with higher restart counts < lower restart counts + if maxContainerRestarts(s[i]) != maxContainerRestarts(s[j]) { + return maxContainerRestarts(s[i]) > maxContainerRestarts(s[j]) + } + // 6. older pods < newer pods < empty timestamp pods + if !s[i].CreationTimestamp.Equal(s[j].CreationTimestamp) { + return afterOrZero(s[j].CreationTimestamp, s[i].CreationTimestamp) + } + return false +} + // ActivePods type allows custom sorting of pods so a controller can pick the best ones to delete. type ActivePods []*api.Pod @@ -619,7 +654,9 @@ func IsPodActive(p api.Pod) bool { func FilterActiveReplicaSets(replicaSets []*extensions.ReplicaSet) []*extensions.ReplicaSet { active := []*extensions.ReplicaSet{} for i := range replicaSets { - if replicaSets[i].Spec.Replicas > 0 { + rs := replicaSets[i] + + if rs != nil && rs.Spec.Replicas > 0 { active = append(active, replicaSets[i]) } } @@ -639,7 +676,6 @@ type ControllersByCreationTimestamp []*api.ReplicationController func (o ControllersByCreationTimestamp) Len() int { return len(o) } func (o ControllersByCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } - func (o ControllersByCreationTimestamp) Less(i, j int) bool { if o[i].CreationTimestamp.Equal(o[j].CreationTimestamp) { return o[i].Name < o[j].Name @@ -647,15 +683,40 @@ func (o ControllersByCreationTimestamp) Less(i, j int) bool { return o[i].CreationTimestamp.Before(o[j].CreationTimestamp) } -// ReplicaSetsByCreationTimestamp sorts a list of ReplicationSets by creation timestamp, using their names as a tie breaker. +// ReplicaSetsByCreationTimestamp sorts a list of ReplicaSet by creation timestamp, using their names as a tie breaker. type ReplicaSetsByCreationTimestamp []*extensions.ReplicaSet func (o ReplicaSetsByCreationTimestamp) Len() int { return len(o) } func (o ReplicaSetsByCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } - func (o ReplicaSetsByCreationTimestamp) Less(i, j int) bool { if o[i].CreationTimestamp.Equal(o[j].CreationTimestamp) { return o[i].Name < o[j].Name } return o[i].CreationTimestamp.Before(o[j].CreationTimestamp) } + +// ReplicaSetsBySizeOlder sorts a list of ReplicaSet by size in descending order, using their creation timestamp or name as a tie breaker. +// By using the creation timestamp, this sorts from old to new replica sets. +type ReplicaSetsBySizeOlder []*extensions.ReplicaSet + +func (o ReplicaSetsBySizeOlder) Len() int { return len(o) } +func (o ReplicaSetsBySizeOlder) Swap(i, j int) { o[i], o[j] = o[j], o[i] } +func (o ReplicaSetsBySizeOlder) Less(i, j int) bool { + if o[i].Spec.Replicas == o[j].Spec.Replicas { + return ReplicaSetsByCreationTimestamp(o).Less(i, j) + } + return o[i].Spec.Replicas > o[j].Spec.Replicas +} + +// ReplicaSetsBySizeNewer sorts a list of ReplicaSet by size in descending order, using their creation timestamp or name as a tie breaker. +// By using the creation timestamp, this sorts from new to old replica sets. +type ReplicaSetsBySizeNewer []*extensions.ReplicaSet + +func (o ReplicaSetsBySizeNewer) Len() int { return len(o) } +func (o ReplicaSetsBySizeNewer) Swap(i, j int) { o[i], o[j] = o[j], o[i] } +func (o ReplicaSetsBySizeNewer) Less(i, j int) bool { + if o[i].Spec.Replicas == o[j].Spec.Replicas { + return ReplicaSetsByCreationTimestamp(o).Less(j, i) + } + return o[i].Spec.Replicas > o[j].Spec.Replicas +} diff --git a/vendor/k8s.io/kubernetes/pkg/util/deployment/deployment.go b/vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go similarity index 59% rename from vendor/k8s.io/kubernetes/pkg/util/deployment/deployment.go rename to vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go index 0442da429..16eb42b24 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/deployment/deployment.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,16 +14,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -package deployment +package util import ( "fmt" + "sort" "strconv" "time" "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/annotations" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" @@ -39,15 +41,269 @@ import ( ) const ( - // The revision annotation of a deployment's replica sets which records its rollout sequence + // RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence RevisionAnnotation = "deployment.kubernetes.io/revision" + // DesiredReplicasAnnotation is the desired replicas for a deployment recorded as an annotation + // in its replica sets. Helps in separating scaling events from the rollout process and for + // determining if the new replica set for a deployment is really saturated. + DesiredReplicasAnnotation = "deployment.kubernetes.io/desired-replicas" + // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which + // is deployment.spec.replicas + maxSurge. Used by the underlying replica sets to estimate their + // proportions in case the deployment has surge replicas. + MaxReplicasAnnotation = "deployment.kubernetes.io/max-replicas" - // Here are the possible rollback event reasons - RollbackRevisionNotFound = "DeploymentRollbackRevisionNotFound" + // RollbackRevisionNotFound is not found rollback event reason + RollbackRevisionNotFound = "DeploymentRollbackRevisionNotFound" + // RollbackTemplateUnchanged is the template unchanged rollback event reason RollbackTemplateUnchanged = "DeploymentRollbackTemplateUnchanged" - RollbackDone = "DeploymentRollback" + // RollbackDone is the done rollback event reason + RollbackDone = "DeploymentRollback" ) +// MaxRevision finds the highest revision in the replica sets +func MaxRevision(allRSs []*extensions.ReplicaSet) int64 { + max := int64(0) + for _, rs := range allRSs { + if v, err := Revision(rs); err != nil { + // Skip the replica sets when it failed to parse their revision information + glog.V(4).Infof("Error: %v. Couldn't parse revision for replica set %#v, deployment controller will skip it when reconciling revisions.", err, rs) + } else if v > max { + max = v + } + } + return max +} + +// LastRevision finds the second max revision number in all replica sets (the last revision) +func LastRevision(allRSs []*extensions.ReplicaSet) int64 { + max, secMax := int64(0), int64(0) + for _, rs := range allRSs { + if v, err := Revision(rs); err != nil { + // Skip the replica sets when it failed to parse their revision information + glog.V(4).Infof("Error: %v. Couldn't parse revision for replica set %#v, deployment controller will skip it when reconciling revisions.", err, rs) + } else if v >= max { + secMax = max + max = v + } else if v > secMax { + secMax = v + } + } + return secMax +} + +// SetNewReplicaSetAnnotations sets new replica set's annotations appropriately by updating its revision and +// copying required deployment annotations to it; it returns true if replica set's annotation is changed. +func SetNewReplicaSetAnnotations(deployment *extensions.Deployment, newRS *extensions.ReplicaSet, newRevision string, exists bool) bool { + // First, copy deployment's annotations (except for apply and revision annotations) + annotationChanged := copyDeploymentAnnotationsToReplicaSet(deployment, newRS) + // Then, update replica set's revision annotation + if newRS.Annotations == nil { + newRS.Annotations = make(map[string]string) + } + // The newRS's revision should be the greatest among all RSes. Usually, its revision number is newRevision (the max revision number + // of all old RSes + 1). However, it's possible that some of the old RSes are deleted after the newRS revision being updated, and + // newRevision becomes smaller than newRS's revision. We should only update newRS revision when it's smaller than newRevision. + if newRS.Annotations[RevisionAnnotation] < newRevision { + newRS.Annotations[RevisionAnnotation] = newRevision + annotationChanged = true + glog.V(4).Infof("Updating replica set %q revision to %s", newRS.Name, newRevision) + } + if !exists && SetReplicasAnnotations(newRS, deployment.Spec.Replicas, deployment.Spec.Replicas+MaxSurge(*deployment)) { + annotationChanged = true + } + return annotationChanged +} + +var annotationsToSkip = map[string]bool{ + annotations.LastAppliedConfigAnnotation: true, + RevisionAnnotation: true, + DesiredReplicasAnnotation: true, + MaxReplicasAnnotation: true, +} + +// skipCopyAnnotation returns true if we should skip copying the annotation with the given annotation key +// TODO: How to decide which annotations should / should not be copied? +// See https://github.com/kubernetes/kubernetes/pull/20035#issuecomment-179558615 +func skipCopyAnnotation(key string) bool { + return annotationsToSkip[key] +} + +// copyDeploymentAnnotationsToReplicaSet copies deployment's annotations to replica set's annotations, +// and returns true if replica set's annotation is changed. +// Note that apply and revision annotations are not copied. +func copyDeploymentAnnotationsToReplicaSet(deployment *extensions.Deployment, rs *extensions.ReplicaSet) bool { + rsAnnotationsChanged := false + if rs.Annotations == nil { + rs.Annotations = make(map[string]string) + } + for k, v := range deployment.Annotations { + // newRS revision is updated automatically in getNewReplicaSet, and the deployment's revision number is then updated + // by copying its newRS revision number. We should not copy deployment's revision to its newRS, since the update of + // deployment revision number may fail (revision becomes stale) and the revision number in newRS is more reliable. + if skipCopyAnnotation(k) || rs.Annotations[k] == v { + continue + } + rs.Annotations[k] = v + rsAnnotationsChanged = true + } + return rsAnnotationsChanged +} + +// SetDeploymentAnnotationsTo sets deployment's annotations as given RS's annotations. +// This action should be done if and only if the deployment is rolling back to this rs. +// Note that apply and revision annotations are not changed. +func SetDeploymentAnnotationsTo(deployment *extensions.Deployment, rollbackToRS *extensions.ReplicaSet) { + deployment.Annotations = getSkippedAnnotations(deployment.Annotations) + for k, v := range rollbackToRS.Annotations { + if !skipCopyAnnotation(k) { + deployment.Annotations[k] = v + } + } +} + +func getSkippedAnnotations(annotations map[string]string) map[string]string { + skippedAnnotations := make(map[string]string) + for k, v := range annotations { + if skipCopyAnnotation(k) { + skippedAnnotations[k] = v + } + } + return skippedAnnotations +} + +// FindActiveOrLatest returns the only active or the latest replica set in case there is at most one active +// replica set. If there are more active replica sets, then we should proportionally scale them. +func FindActiveOrLatest(newRS *extensions.ReplicaSet, oldRSs []*extensions.ReplicaSet) *extensions.ReplicaSet { + if newRS == nil && len(oldRSs) == 0 { + return nil + } + + sort.Sort(sort.Reverse(controller.ReplicaSetsByCreationTimestamp(oldRSs))) + allRSs := controller.FilterActiveReplicaSets(append(oldRSs, newRS)) + + switch len(allRSs) { + case 0: + // If there is no active replica set then we should return the newest. + if newRS != nil { + return newRS + } + return oldRSs[0] + case 1: + return allRSs[0] + default: + return nil + } +} + +// GetDesiredReplicasAnnotation returns the number of desired replicas +func GetDesiredReplicasAnnotation(rs *extensions.ReplicaSet) (int32, bool) { + return getIntFromAnnotation(rs, DesiredReplicasAnnotation) +} + +func getMaxReplicasAnnotation(rs *extensions.ReplicaSet) (int32, bool) { + return getIntFromAnnotation(rs, MaxReplicasAnnotation) +} + +func getIntFromAnnotation(rs *extensions.ReplicaSet, annotationKey string) (int32, bool) { + annotationValue, ok := rs.Annotations[annotationKey] + if !ok { + return int32(0), false + } + intValue, err := strconv.Atoi(annotationValue) + if err != nil { + glog.Warningf("Cannot convert the value %q with annotation key %q for the replica set %q", + annotationValue, annotationKey, rs.Name) + return int32(0), false + } + return int32(intValue), true +} + +// SetReplicasAnnotations sets the desiredReplicas and maxReplicas into the annotations +func SetReplicasAnnotations(rs *extensions.ReplicaSet, desiredReplicas, maxReplicas int32) bool { + updated := false + if rs.Annotations == nil { + rs.Annotations = make(map[string]string) + } + desiredString := fmt.Sprintf("%d", desiredReplicas) + if hasString := rs.Annotations[DesiredReplicasAnnotation]; hasString != desiredString { + rs.Annotations[DesiredReplicasAnnotation] = desiredString + updated = true + } + maxString := fmt.Sprintf("%d", maxReplicas) + if hasString := rs.Annotations[MaxReplicasAnnotation]; hasString != maxString { + rs.Annotations[MaxReplicasAnnotation] = maxString + updated = true + } + return updated +} + +// MaxUnavailable returns the maximum unavailable pods a rolling deployment can take. +func MaxUnavailable(deployment extensions.Deployment) int32 { + if !IsRollingUpdate(&deployment) { + return int32(0) + } + // Error caught by validation + _, maxUnavailable, _ := ResolveFenceposts(&deployment.Spec.Strategy.RollingUpdate.MaxSurge, &deployment.Spec.Strategy.RollingUpdate.MaxUnavailable, deployment.Spec.Replicas) + return maxUnavailable +} + +// MaxSurge returns the maximum surge pods a rolling deployment can take. +func MaxSurge(deployment extensions.Deployment) int32 { + if !IsRollingUpdate(&deployment) { + return int32(0) + } + // Error caught by validation + maxSurge, _, _ := ResolveFenceposts(&deployment.Spec.Strategy.RollingUpdate.MaxSurge, &deployment.Spec.Strategy.RollingUpdate.MaxUnavailable, deployment.Spec.Replicas) + return maxSurge +} + +// GetProportion will estimate the proportion for the provided replica set using 1. the current size +// of the parent deployment, 2. the replica count that needs be added on the replica sets of the +// deployment, and 3. the total replicas added in the replica sets of the deployment so far. +func GetProportion(rs *extensions.ReplicaSet, d extensions.Deployment, deploymentReplicasToAdd, deploymentReplicasAdded int32) int32 { + if rs == nil || rs.Spec.Replicas == 0 || deploymentReplicasToAdd == 0 || deploymentReplicasToAdd == deploymentReplicasAdded { + return int32(0) + } + + rsFraction := getReplicaSetFraction(*rs, d) + allowed := deploymentReplicasToAdd - deploymentReplicasAdded + + if deploymentReplicasToAdd > 0 { + // Use the minimum between the replica set fraction and the maximum allowed replicas + // when scaling up. This way we ensure we will not scale up more than the allowed + // replicas we can add. + return integer.Int32Min(rsFraction, allowed) + } + // Use the maximum between the replica set fraction and the maximum allowed replicas + // when scaling down. This way we ensure we will not scale down more than the allowed + // replicas we can remove. + return integer.Int32Max(rsFraction, allowed) +} + +// getReplicaSetFraction estimates the fraction of replicas a replica set can have in +// 1. a scaling event during a rollout or 2. when scaling a paused deployment. +func getReplicaSetFraction(rs extensions.ReplicaSet, d extensions.Deployment) int32 { + // If we are scaling down to zero then the fraction of this replica set is its whole size (negative) + if d.Spec.Replicas == int32(0) { + return -rs.Spec.Replicas + } + + deploymentReplicas := d.Spec.Replicas + MaxSurge(d) + annotatedReplicas, ok := getMaxReplicasAnnotation(&rs) + if !ok { + // If we cannot find the annotation then fallback to the current deployment size. Note that this + // will not be an accurate proportion estimation in case other replica sets have different values + // which means that the deployment was scaled at some point but we at least will stay in limits + // due to the min-max comparisons in getProportion. + annotatedReplicas = d.Status.Replicas + } + + // We should never proportionally scale up from zero which means rs.spec.replicas and annotatedReplicas + // will never be zero here. + newRSsize := (float64(rs.Spec.Replicas * deploymentReplicas)) / float64(annotatedReplicas) + return integer.RoundToInt32(newRSsize) - rs.Spec.Replicas +} + // GetAllReplicaSets returns the old and new replica sets targeted by the given Deployment. It gets PodList and ReplicaSetList from client interface. // Note that the first set of old replica sets doesn't include the ones with no pods, and the second set of old replica sets include all old replica sets. // The third returned value is the new replica set, and it may be nil if it doesn't exist yet. @@ -219,6 +475,7 @@ func FindOldReplicaSets(deployment *extensions.Deployment, rsList []extensions.R return requiredRSs, allRSs, nil } +// WaitForReplicaSetUpdated polls the replica set until it is updated. func WaitForReplicaSetUpdated(c clientset.Interface, desiredGeneration int64, namespace, name string) error { return wait.Poll(10*time.Millisecond, 1*time.Minute, func() (bool, error) { rs, err := c.Extensions().ReplicaSets(namespace).Get(name) @@ -229,6 +486,7 @@ func WaitForReplicaSetUpdated(c clientset.Interface, desiredGeneration int64, na }) } +// WaitForPodsHashPopulated polls the replica set until updated and fully labeled. func WaitForPodsHashPopulated(c clientset.Interface, desiredGeneration int64, namespace, name string) error { return wait.Poll(1*time.Second, 1*time.Minute, func() (bool, error) { rs, err := c.Extensions().ReplicaSets(namespace).Get(name) @@ -269,7 +527,7 @@ func LabelPodsWithHash(podList *api.PodList, rs *extensions.ReplicaSet, c client return allPodsLabeled, nil } -// Returns the desired PodTemplateSpec for the new ReplicaSet corresponding to the given ReplicaSet. +// GetNewReplicaSetTemplate returns the desired PodTemplateSpec for the new ReplicaSet corresponding to the given ReplicaSet. func GetNewReplicaSetTemplate(deployment *extensions.Deployment) api.PodTemplateSpec { // newRS will have the same template as in deployment spec, plus a unique label in some cases. newRSTemplate := api.PodTemplateSpec{ @@ -293,7 +551,7 @@ func SetFromReplicaSetTemplate(deployment *extensions.Deployment, template api.P return deployment } -// Returns the sum of Replicas of the given replica sets. +// GetReplicaCountForReplicaSets returns the sum of Replicas of the given replica sets. func GetReplicaCountForReplicaSets(replicaSets []*extensions.ReplicaSet) int32 { totalReplicaCount := int32(0) for _, rs := range replicaSets { @@ -346,14 +604,17 @@ func GetAvailablePodsForDeployment(c clientset.Interface, deployment *extensions func countAvailablePods(pods []api.Pod, minReadySeconds int32) int32 { availablePodCount := int32(0) for _, pod := range pods { - if IsPodAvailable(&pod, minReadySeconds) { + // TODO: Make the time.Now() as argument to allow unit test this. + if IsPodAvailable(&pod, minReadySeconds, time.Now()) { + glog.V(4).Infof("Pod %s/%s is available.", pod.Namespace, pod.Name) availablePodCount++ } } return availablePodCount } -func IsPodAvailable(pod *api.Pod, minReadySeconds int32) bool { +// IsPodAvailable return true if the pod is available. +func IsPodAvailable(pod *api.Pod, minReadySeconds int32, now time.Time) bool { if !controller.IsPodActive(*pod) { return false } @@ -366,7 +627,7 @@ func IsPodAvailable(pod *api.Pod, minReadySeconds int32) bool { // 1. minReadySeconds == 0, or // 2. LastTransitionTime (is set) + minReadySeconds (>0) < current time minReadySecondsDuration := time.Duration(minReadySeconds) * time.Second - if minReadySeconds == 0 || !c.LastTransitionTime.IsZero() && c.LastTransitionTime.Add(minReadySecondsDuration).Before(time.Now()) { + if minReadySeconds == 0 || !c.LastTransitionTime.IsZero() && c.LastTransitionTime.Add(minReadySecondsDuration).Before(now) { return true } } @@ -399,6 +660,7 @@ func Revision(rs *extensions.ReplicaSet) (int64, error) { return strconv.ParseInt(v, 10, 64) } +// IsRollingUpdate returns true if the strategy type is a rolling update. func IsRollingUpdate(deployment *extensions.Deployment) bool { return deployment.Spec.Strategy.Type == extensions.RollingUpdateDeploymentStrategyType } @@ -434,7 +696,22 @@ func NewRSNewReplicas(deployment *extensions.Deployment, allRSs []*extensions.Re } } -// Polls for deployment to be updated so that deployment.Status.ObservedGeneration >= desiredGeneration. +// IsSaturated checks if the new replica set is saturated by comparing its size with its deployment size. +// Both the deployment and the replica set have to believe this replica set can own all of the desired +// replicas in the deployment and the annotation helps in achieving that. +func IsSaturated(deployment *extensions.Deployment, rs *extensions.ReplicaSet) bool { + if rs == nil { + return false + } + desiredString := rs.Annotations[DesiredReplicasAnnotation] + desired, err := strconv.Atoi(desiredString) + if err != nil { + return false + } + return rs.Spec.Replicas == deployment.Spec.Replicas && int32(desired) == deployment.Spec.Replicas +} + +// WaitForObservedDeployment polls for deployment to be updated so that deployment.Status.ObservedGeneration >= desiredGeneration. // Returns error if polling timesout. func WaitForObservedDeployment(getDeploymentFunc func() (*extensions.Deployment, error), desiredGeneration int64, interval, timeout time.Duration) error { // TODO: This should take clientset.Interface when all code is updated to use clientset. Keeping it this way allows the function to be used by callers who have client.Interface. @@ -476,3 +753,15 @@ func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired return int32(surge), int32(unavailable), nil } + +func DeploymentDeepCopy(deployment *extensions.Deployment) (*extensions.Deployment, error) { + objCopy, err := api.Scheme.DeepCopy(deployment) + if err != nil { + return nil, err + } + copied, ok := objCopy.(*extensions.Deployment) + if !ok { + return nil, fmt.Errorf("expected Deployment, got %#v", objCopy) + } + return copied, nil +} diff --git a/vendor/k8s.io/kubernetes/pkg/controller/doc.go b/vendor/k8s.io/kubernetes/pkg/controller/doc.go index 1e310b466..ded390582 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/controller/framework/controller.go b/vendor/k8s.io/kubernetes/pkg/controller/framework/controller.go index c6363952b..8cbd124a3 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/framework/controller.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/framework/controller.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/controller/framework/doc.go b/vendor/k8s.io/kubernetes/pkg/controller/framework/doc.go index ecd3cf28a..feceba36c 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/framework/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/framework/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/controller/framework/fake_controller_source.go b/vendor/k8s.io/kubernetes/pkg/controller/framework/fake_controller_source.go index bebacb531..ee00c0586 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/framework/fake_controller_source.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/framework/fake_controller_source.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -31,17 +31,41 @@ import ( func NewFakeControllerSource() *FakeControllerSource { return &FakeControllerSource{ - items: map[nnu]runtime.Object{}, - broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), + Items: map[nnu]runtime.Object{}, + Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), } } +func NewFakePVControllerSource() *FakePVControllerSource { + return &FakePVControllerSource{ + FakeControllerSource{ + Items: map[nnu]runtime.Object{}, + Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), + }} +} + +func NewFakePVCControllerSource() *FakePVCControllerSource { + return &FakePVCControllerSource{ + FakeControllerSource{ + Items: map[nnu]runtime.Object{}, + Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), + }} +} + // FakeControllerSource implements listing/watching for testing. type FakeControllerSource struct { lock sync.RWMutex - items map[nnu]runtime.Object + Items map[nnu]runtime.Object changes []watch.Event // one change per resourceVersion - broadcaster *watch.Broadcaster + Broadcaster *watch.Broadcaster +} + +type FakePVControllerSource struct { + FakeControllerSource +} + +type FakePVCControllerSource struct { + FakeControllerSource } // namespace, name, uid to be used as a key. @@ -110,22 +134,19 @@ func (f *FakeControllerSource) Change(e watch.Event, watchProbability float64) { key := f.key(accessor) switch e.Type { case watch.Added, watch.Modified: - f.items[key] = e.Object + f.Items[key] = e.Object case watch.Deleted: - delete(f.items, key) + delete(f.Items, key) } if rand.Float64() < watchProbability { - f.broadcaster.Action(e.Type, e.Object) + f.Broadcaster.Action(e.Type, e.Object) } } -// List returns a list object, with its resource version set. -func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, error) { - f.lock.RLock() - defer f.lock.RUnlock() - list := make([]runtime.Object, 0, len(f.items)) - for _, obj := range f.items { +func (f *FakeControllerSource) getListItemsLocked() ([]runtime.Object, error) { + list := make([]runtime.Object, 0, len(f.Items)) + for _, obj := range f.Items { // Must make a copy to allow clients to modify the object. // Otherwise, if they make a change and write it back, they // will inadvertently change our canonical copy (in @@ -136,6 +157,17 @@ func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, er } list = append(list, objCopy.(runtime.Object)) } + return list, nil +} + +// List returns a list object, with its resource version set. +func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, error) { + f.lock.RLock() + defer f.lock.RUnlock() + list, err := f.getListItemsLocked() + if err != nil { + return nil, err + } listObj := &api.List{} if err := meta.SetList(listObj, list); err != nil { return nil, err @@ -149,6 +181,48 @@ func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, er return listObj, nil } +// List returns a list object, with its resource version set. +func (f *FakePVControllerSource) List(options api.ListOptions) (runtime.Object, error) { + f.lock.RLock() + defer f.lock.RUnlock() + list, err := f.FakeControllerSource.getListItemsLocked() + if err != nil { + return nil, err + } + listObj := &api.PersistentVolumeList{} + if err := meta.SetList(listObj, list); err != nil { + return nil, err + } + objMeta, err := api.ListMetaFor(listObj) + if err != nil { + return nil, err + } + resourceVersion := len(f.changes) + objMeta.ResourceVersion = strconv.Itoa(resourceVersion) + return listObj, nil +} + +// List returns a list object, with its resource version set. +func (f *FakePVCControllerSource) List(options api.ListOptions) (runtime.Object, error) { + f.lock.RLock() + defer f.lock.RUnlock() + list, err := f.FakeControllerSource.getListItemsLocked() + if err != nil { + return nil, err + } + listObj := &api.PersistentVolumeClaimList{} + if err := meta.SetList(listObj, list); err != nil { + return nil, err + } + objMeta, err := api.ListMetaFor(listObj) + if err != nil { + return nil, err + } + resourceVersion := len(f.changes) + objMeta.ResourceVersion = strconv.Itoa(resourceVersion) + return listObj, nil +} + // Watch returns a watch, which will be pre-populated with all changes // after resourceVersion. func (f *FakeControllerSource) Watch(options api.ListOptions) (watch.Interface, error) { @@ -172,11 +246,11 @@ func (f *FakeControllerSource) Watch(options api.ListOptions) (watch.Interface, } changes = append(changes, watch.Event{Type: c.Type, Object: objCopy.(runtime.Object)}) } - return f.broadcaster.WatchWithPrefix(changes), nil + return f.Broadcaster.WatchWithPrefix(changes), nil } else if rc > len(f.changes) { return nil, errors.New("resource version in the future not supported by this fake") } - return f.broadcaster.Watch(), nil + return f.Broadcaster.Watch(), nil } // Shutdown closes the underlying broadcaster, waiting for events to be @@ -184,5 +258,5 @@ func (f *FakeControllerSource) Watch(options api.ListOptions) (watch.Interface, // enforced by Shutdown() leaving f locked. func (f *FakeControllerSource) Shutdown() { f.lock.Lock() // Purposely no unlock. - f.broadcaster.Shutdown() + f.Broadcaster.Shutdown() } diff --git a/vendor/k8s.io/kubernetes/pkg/controller/framework/shared_informer.go b/vendor/k8s.io/kubernetes/pkg/controller/framework/shared_informer.go index c557bf975..87dcac6d2 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/framework/shared_informer.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/framework/shared_informer.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -44,6 +44,7 @@ type SharedInformer interface { GetController() ControllerInterface Run(stopCh <-chan struct{}) HasSynced() bool + LastSyncResourceVersion() string } type SharedIndexInformer interface { @@ -87,6 +88,13 @@ type sharedIndexInformer struct { started bool startedLock sync.Mutex + + // blockDeltas gives a way to stop all event distribution so that a late event handler + // can safely join the shared informer. + blockDeltas sync.Mutex + // stopCh is the channel used to stop the main Run process. We have to track it so that + // late joiners can have a proper stop + stopCh <-chan struct{} } // dummyController hides the fact that a SharedInformer is different from a dedicated one @@ -141,6 +149,7 @@ func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { s.started = true }() + s.stopCh = stopCh s.processor.run(stopCh) s.controller.Run(stopCh) } @@ -161,6 +170,16 @@ func (s *sharedIndexInformer) HasSynced() bool { return s.controller.HasSynced() } +func (s *sharedIndexInformer) LastSyncResourceVersion() string { + s.startedLock.Lock() + defer s.startedLock.Unlock() + + if s.controller == nil { + return "" + } + return s.controller.reflector.LastSyncResourceVersion() +} + func (s *sharedIndexInformer) GetStore() cache.Store { return s.indexer } @@ -188,16 +207,38 @@ func (s *sharedIndexInformer) AddEventHandler(handler ResourceEventHandler) erro s.startedLock.Lock() defer s.startedLock.Unlock() - if s.started { - return fmt.Errorf("informer has already started") + if !s.started { + listener := newProcessListener(handler) + s.processor.listeners = append(s.processor.listeners, listener) + return nil } + // in order to safely join, we have to + // 1. stop sending add/update/delete notifications + // 2. do a list against the store + // 3. send synthetic "Add" events to the new handler + // 4. unblock + s.blockDeltas.Lock() + defer s.blockDeltas.Unlock() + listener := newProcessListener(handler) s.processor.listeners = append(s.processor.listeners, listener) + + go listener.run(s.stopCh) + go listener.pop(s.stopCh) + + items := s.indexer.List() + for i := range items { + listener.add(addNotification{newObj: items[i]}) + } + return nil } func (s *sharedIndexInformer) HandleDeltas(obj interface{}) error { + s.blockDeltas.Lock() + defer s.blockDeltas.Unlock() + // from oldest to newest for _, d := range obj.(cache.Deltas) { switch d.Type { diff --git a/vendor/k8s.io/kubernetes/pkg/controller/lookup_cache.go b/vendor/k8s.io/kubernetes/pkg/controller/lookup_cache.go index 0333eff38..84029c5f3 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/lookup_cache.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/lookup_cache.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/conversion/cloner.go b/vendor/k8s.io/kubernetes/pkg/conversion/cloner.go index a8c574713..e4e74f636 100644 --- a/vendor/k8s.io/kubernetes/pkg/conversion/cloner.go +++ b/vendor/k8s.io/kubernetes/pkg/conversion/cloner.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/conversion/converter.go b/vendor/k8s.io/kubernetes/pkg/conversion/converter.go index e045dcd2f..7a18d6360 100644 --- a/vendor/k8s.io/kubernetes/pkg/conversion/converter.go +++ b/vendor/k8s.io/kubernetes/pkg/conversion/converter.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/conversion/deep_equal.go b/vendor/k8s.io/kubernetes/pkg/conversion/deep_equal.go index 7c3ed7cda..6bfc870a3 100644 --- a/vendor/k8s.io/kubernetes/pkg/conversion/deep_equal.go +++ b/vendor/k8s.io/kubernetes/pkg/conversion/deep_equal.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -17,7 +17,7 @@ limitations under the License. package conversion import ( - "k8s.io/kubernetes/third_party/forked/reflect" + "k8s.io/kubernetes/third_party/forked/golang/reflect" ) // The code for this type must be located in third_party, since it forks from @@ -26,7 +26,7 @@ type Equalities struct { reflect.Equalities } -// For convenience, panics on errrors +// For convenience, panics on errors func EqualitiesOrDie(funcs ...interface{}) Equalities { e := Equalities{reflect.Equalities{}} if err := e.AddFuncs(funcs...); err != nil { diff --git a/vendor/k8s.io/kubernetes/pkg/conversion/doc.go b/vendor/k8s.io/kubernetes/pkg/conversion/doc.go index 3ef2eaba4..0c46ef2d1 100644 --- a/vendor/k8s.io/kubernetes/pkg/conversion/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/conversion/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/conversion/helper.go b/vendor/k8s.io/kubernetes/pkg/conversion/helper.go index 39f782659..4ebc1ebc5 100644 --- a/vendor/k8s.io/kubernetes/pkg/conversion/helper.go +++ b/vendor/k8s.io/kubernetes/pkg/conversion/helper.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/convert.go b/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/convert.go index 63c545697..30f717b2c 100644 --- a/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/convert.go +++ b/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/convert.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/doc.go b/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/doc.go index 0e9127a18..4c1002a4c 100644 --- a/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/conversion/queryparams/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go b/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go index b80fa5945..582c1ef27 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/doc.go b/vendor/k8s.io/kubernetes/pkg/credentialprovider/doc.go index f071c0c89..41c12410f 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go b/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go index eedbee5ad..ed712ccfd 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugins.go b/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugins.go index a871cc02b..76c2e7249 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugins.go +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugins.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go b/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go index 215650392..52f4045b8 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go b/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go index c91ff6eca..83cbdce0c 100644 --- a/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/fieldpath/fieldpath.go b/vendor/k8s.io/kubernetes/pkg/fieldpath/fieldpath.go index bede9b2c0..4de70460b 100644 --- a/vendor/k8s.io/kubernetes/pkg/fieldpath/fieldpath.go +++ b/vendor/k8s.io/kubernetes/pkg/fieldpath/fieldpath.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/fields/doc.go b/vendor/k8s.io/kubernetes/pkg/fields/doc.go index 767615c9f..49059e263 100644 --- a/vendor/k8s.io/kubernetes/pkg/fields/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/fields/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/fields/fields.go b/vendor/k8s.io/kubernetes/pkg/fields/fields.go index 50fef14a8..623b27e95 100644 --- a/vendor/k8s.io/kubernetes/pkg/fields/fields.go +++ b/vendor/k8s.io/kubernetes/pkg/fields/fields.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/fields/selector.go b/vendor/k8s.io/kubernetes/pkg/fields/selector.go index c0a638581..eef44d356 100644 --- a/vendor/k8s.io/kubernetes/pkg/fields/selector.go +++ b/vendor/k8s.io/kubernetes/pkg/fields/selector.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/healthz/doc.go b/vendor/k8s.io/kubernetes/pkg/healthz/doc.go index 37a95b806..a70a0eaaf 100644 --- a/vendor/k8s.io/kubernetes/pkg/healthz/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/healthz/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/healthz/healthz.go b/vendor/k8s.io/kubernetes/pkg/healthz/healthz.go index 5a9af7aa1..b71797d75 100644 --- a/vendor/k8s.io/kubernetes/pkg/healthz/healthz.go +++ b/vendor/k8s.io/kubernetes/pkg/healthz/healthz.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/OWNERS b/vendor/k8s.io/kubernetes/pkg/kubectl/OWNERS index 60bc436d4..26e3e7540 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/OWNERS +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/OWNERS @@ -1,5 +1,4 @@ assignees: - - bgrant0607 - brendandburns - deads2k - janetkuo diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/apply.go b/vendor/k8s.io/kubernetes/pkg/kubectl/apply.go index 1836fc250..6f183f1c0 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/apply.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/apply.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/autoscale.go b/vendor/k8s.io/kubernetes/pkg/kubectl/autoscale.go index 979a93bf0..6e5f5a24e 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/autoscale.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/autoscale.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/bash_comp_utils.go b/vendor/k8s.io/kubernetes/pkg/kubectl/bash_comp_utils.go index e3eaf30e4..346200276 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/bash_comp_utils.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/bash_comp_utils.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/clientcache.go b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/clientcache.go index 43ddf3e98..039f5048c 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/clientcache.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/clientcache.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/factory.go b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/factory.go index 76df00b0d..2c2214951 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/factory.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -48,6 +48,7 @@ import ( "k8s.io/kubernetes/pkg/apis/apps" "k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/batch" + "k8s.io/kubernetes/pkg/apis/certificates" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/policy" "k8s.io/kubernetes/pkg/apis/rbac" @@ -253,14 +254,14 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { // have been dynamically added to the apiserver Object: func(discoverDynamicAPIs bool) (meta.RESTMapper, runtime.ObjectTyper) { cfg, err := clientConfig.ClientConfig() - CheckErr(err) + checkErrWithPrefix("failed to get client config: ", err) cmdApiVersion := unversioned.GroupVersion{} if cfg.GroupVersion != nil { cmdApiVersion = *cfg.GroupVersion } if discoverDynamicAPIs { client, err := clients.ClientForVersion(&unversioned.GroupVersion{Version: "v1"}) - CheckErr(err) + checkErrWithPrefix("failed to find client for version v1: ", err) var versions []unversioned.GroupVersion var gvks []unversioned.GroupVersionKind @@ -274,7 +275,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { break } } - CheckErr(err) + checkErrWithPrefix("failed to get third-party group versions: ", err) if len(versions) > 0 { priorityMapper, ok := mapper.RESTMapper.(meta.PriorityRESTMapper) if !ok { @@ -294,7 +295,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { preferredExternalVersion := versionList[0] thirdPartyMapper, err := kubectl.NewThirdPartyResourceMapper(versionList, getGroupVersionKinds(gvks, group)) - CheckErr(err) + checkErrWithPrefix("failed to create third party resource mapper: ", err) accessor := meta.NewAccessor() groupMeta := apimachinery.GroupMeta{ GroupVersion: preferredExternalVersion, @@ -304,7 +305,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { InterfacesFor: makeInterfacesFor(versionList), } - CheckErr(registered.RegisterGroup(groupMeta)) + checkErrWithPrefix("failed to register group: ", registered.RegisterGroup(groupMeta)) registered.AddThirdPartyAPIGroupVersions(versionList...) multiMapper = append(meta.MultiRESTMapper{thirdPartyMapper}, multiMapper...) } @@ -366,6 +367,8 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { return clients.FederationClientForVersion(&mappingVersion) case rbac.GroupName: return c.RbacClient.RESTClient, nil + case certificates.GroupName: + return c.CertificatesClient.RESTClient, nil default: if !registered.IsThirdPartyAPIGroupVersion(gvk.GroupVersion()) { return nil, fmt.Errorf("unknown api group/version: %s", gvk.String()) @@ -377,7 +380,6 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { gv := gvk.GroupVersion() cfg.GroupVersion = &gv cfg.APIPath = "/apis" - cfg.Codec = thirdpartyresourcedata.NewCodec(c.ExtensionsClient.RESTClient.Codec(), gvk) cfg.NegotiatedSerializer = thirdpartyresourcedata.NewNegotiatedSerializer(api.Codecs, gvk.Kind, gv, gv) return restclient.RESTClientFor(cfg) } @@ -520,7 +522,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { return nil, errors.New("provided options object is not a PodLogOptions") } selector := labels.SelectorFromSet(t.Spec.Selector) - sortBy := func(pods []*api.Pod) sort.Interface { return controller.ActivePods(pods) } + sortBy := func(pods []*api.Pod) sort.Interface { return controller.ByLogging(pods) } pod, numPods, err := GetFirstPod(c, t.Namespace, selector, 20*time.Second, sortBy) if err != nil { return nil, err @@ -540,7 +542,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { if err != nil { return nil, fmt.Errorf("invalid label selector: %v", err) } - sortBy := func(pods []*api.Pod) sort.Interface { return controller.ActivePods(pods) } + sortBy := func(pods []*api.Pod) sort.Interface { return controller.ByLogging(pods) } pod, numPods, err := GetFirstPod(c, t.Namespace, selector, 20*time.Second, sortBy) if err != nil { return nil, err @@ -800,7 +802,7 @@ See http://releases.k8s.io/HEAD/docs/user-guide/services-firewalls.md for more d // GetFirstPod returns a pod matching the namespace and label selector // and the number of all pods that match the label selector. -func GetFirstPod(client client.Interface, namespace string, selector labels.Selector, timeout time.Duration, sortBy func([]*api.Pod) sort.Interface) (*api.Pod, int, error) { +func GetFirstPod(client client.PodsNamespacer, namespace string, selector labels.Selector, timeout time.Duration, sortBy func([]*api.Pod) sort.Interface) (*api.Pod, int, error) { options := api.ListOptions{LabelSelector: selector} podList, err := client.Pods(namespace).List(options) @@ -1104,6 +1106,12 @@ func (c *clientSwaggerSchema) ValidateBytes(data []byte) error { } return getSchemaAndValidate(c.fedc, data, "apis/", gvk.GroupVersion().String(), c.cacheDir, c) } + if gvk.Group == certificates.GroupName { + if c.c.CertificatesClient == nil { + return errors.New("unable to validate: no certificates client") + } + return getSchemaAndValidate(c.c.CertificatesClient.RESTClient, data, "apis/", gvk.GroupVersion().String(), c.cacheDir, c) + } return getSchemaAndValidate(c.c.RESTClient, data, "api", gvk.GroupVersion().String(), c.cacheDir, c) } diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/helpers.go b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/helpers.go index 218a2f9c9..b00b0d13d 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/helpers.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/helpers.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -105,17 +105,22 @@ func fatal(msg string) { // This method is generic to the command in use and may be used by non-Kubectl // commands. func CheckErr(err error) { - checkErr(err, fatalErrHandler) + checkErr("", err, fatalErrHandler) } -func checkErr(err error, handleErr func(string)) { +// checkErrWithPrefix works like CheckErr, but adds a caller-defined prefix to non-nil errors +func checkErrWithPrefix(prefix string, err error) { + checkErr(prefix, err, fatalErrHandler) +} + +func checkErr(pref string, err error, handleErr func(string)) { if err == nil { return } if errors.IsInvalid(err) { details := err.(*errors.StatusError).Status().Details - prefix := fmt.Sprintf("The %s %q is invalid.\n", details.Kind, details.Name) + prefix := fmt.Sprintf("%sThe %s %q is invalid.\n", pref, details.Kind, details.Name) errs := statusCausesToAggrError(details.Causes) handleErr(MultilineError(prefix, errs)) } @@ -125,23 +130,23 @@ func checkErr(err error, handleErr func(string)) { switch { case len(noMatch.PartialResource.Group) > 0 && len(noMatch.PartialResource.Version) > 0: - handleErr(fmt.Sprintf("the server doesn't have a resource type %q in group %q and version %q", noMatch.PartialResource.Resource, noMatch.PartialResource.Group, noMatch.PartialResource.Version)) + handleErr(fmt.Sprintf("%sthe server doesn't have a resource type %q in group %q and version %q", pref, noMatch.PartialResource.Resource, noMatch.PartialResource.Group, noMatch.PartialResource.Version)) case len(noMatch.PartialResource.Group) > 0: - handleErr(fmt.Sprintf("the server doesn't have a resource type %q in group %q", noMatch.PartialResource.Resource, noMatch.PartialResource.Group)) + handleErr(fmt.Sprintf("%sthe server doesn't have a resource type %q in group %q", pref, noMatch.PartialResource.Resource, noMatch.PartialResource.Group)) case len(noMatch.PartialResource.Version) > 0: - handleErr(fmt.Sprintf("the server doesn't have a resource type %q in version %q", noMatch.PartialResource.Resource, noMatch.PartialResource.Version)) + handleErr(fmt.Sprintf("%sthe server doesn't have a resource type %q in version %q", pref, noMatch.PartialResource.Resource, noMatch.PartialResource.Version)) default: - handleErr(fmt.Sprintf("the server doesn't have a resource type %q", noMatch.PartialResource.Resource)) + handleErr(fmt.Sprintf("%sthe server doesn't have a resource type %q", pref, noMatch.PartialResource.Resource)) } return } // handle multiline errors if clientcmd.IsConfigurationInvalid(err) { - handleErr(MultilineError("Error in configuration: ", err)) + handleErr(MultilineError(fmt.Sprintf("%sError in configuration: ", pref), err)) } if agg, ok := err.(utilerrors.Aggregate); ok && len(agg.Errors()) > 0 { - handleErr(MultipleErrors("", agg.Errors())) + handleErr(MultipleErrors(pref, agg.Errors())) } msg, ok := StandardErrorMessage(err) @@ -151,7 +156,7 @@ func checkErr(err error, handleErr func(string)) { msg = fmt.Sprintf("error: %s", msg) } } - handleErr(msg) + handleErr(fmt.Sprintf("%s%s", pref, msg)) } func statusCausesToAggrError(scs []unversioned.StatusCause) utilerrors.Aggregate { diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/printing.go b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/printing.go index f1153b6cd..e95e4ca68 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/printing.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/printing.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -30,9 +30,9 @@ import ( // AddPrinterFlags adds printing related flags to a command (e.g. output format, no headers, template path) func AddPrinterFlags(cmd *cobra.Command) { - cmd.Flags().StringP("output", "o", "", "Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].") + AddOutputFlags(cmd) cmd.Flags().String("output-version", "", "Output the formatted object with the given group version (for ex: 'extensions/v1beta1').") - cmd.Flags().Bool("no-headers", false, "When using the default output, don't print headers.") + AddNoHeadersFlags(cmd) cmd.Flags().Bool("show-labels", false, "When printing, show all labels as the last column (default hide labels column)") cmd.Flags().String("template", "", "Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].") cmd.MarkFlagFilename("template") @@ -45,6 +45,16 @@ func AddOutputFlagsForMutation(cmd *cobra.Command) { cmd.Flags().StringP("output", "o", "", "Output mode. Use \"-o name\" for shorter output (resource/name).") } +// AddOutputFlags adds output related flags to a command. +func AddOutputFlags(cmd *cobra.Command) { + cmd.Flags().StringP("output", "o", "", "Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].") +} + +// AddNoHeadersFlags adds no-headers flags to a command. +func AddNoHeadersFlags(cmd *cobra.Command) { + cmd.Flags().Bool("no-headers", false, "When using the default or custom-column output format, don't print headers.") +} + // PrintSuccess prints message after finishing mutating operations func PrintSuccess(mapper meta.RESTMapper, shortOutput bool, out io.Writer, resource string, name string, operation string) { resource, _ = mapper.ResourceSingularizer(resource) @@ -111,7 +121,7 @@ func PrinterForCommand(cmd *cobra.Command) (kubectl.ResourcePrinter, bool, error } } - printer, generic, err := kubectl.GetPrinter(outputFormat, templateFile) + printer, generic, err := kubectl.GetPrinter(outputFormat, templateFile, GetFlagBool(cmd, "no-headers")) if err != nil { return nil, generic, err } diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/configmap.go b/vendor/k8s.io/kubernetes/pkg/kubectl/configmap.go index 04ed4aa6a..3e3a6c06c 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/configmap.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ import ( "strings" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/util/validation" ) // ConfigMapGeneratorV1 supports stable generation of a configMap. @@ -199,10 +199,9 @@ func addKeyFromFileToConfigMap(configMap *api.ConfigMap, keyName, filePath strin // addKeyFromLiteralToConfigMap adds the given key and data to the given config map, // returning an error if the key is not valid or if the key already exists. func addKeyFromLiteralToConfigMap(configMap *api.ConfigMap, keyName, data string) error { - // Note, the rules for ConfigMap keys are the exact same as the ones for SecretKeys - // to be consistent; validation.IsSecretKey is used here intentionally. - if !validation.IsSecretKey(keyName) { - return fmt.Errorf("%v is not a valid key name for a configMap", keyName) + // Note, the rules for ConfigMap keys are the exact same as the ones for SecretKeys. + if errs := validation.IsConfigMapKey(keyName); len(errs) != 0 { + return fmt.Errorf("%q is not a valid key name for a ConfigMap: %s", keyName, strings.Join(errs, ";")) } if _, entryExists := configMap.Data[keyName]; entryExists { return fmt.Errorf("cannot add key %s, another key by that name already exists: %v.", keyName, configMap.Data) diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/custom_column_printer.go b/vendor/k8s.io/kubernetes/pkg/kubectl/custom_column_printer.go index 255ad1de8..3d51f63cb 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/custom_column_printer.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/custom_column_printer.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -73,7 +73,7 @@ func massageJSONPath(pathExpression string) (string, error) { // // NAME API_VERSION // foo bar -func NewCustomColumnsPrinterFromSpec(spec string, decoder runtime.Decoder) (*CustomColumnsPrinter, error) { +func NewCustomColumnsPrinterFromSpec(spec string, decoder runtime.Decoder, noHeaders bool) (*CustomColumnsPrinter, error) { if len(spec) == 0 { return nil, fmt.Errorf("custom-columns format specified but no custom columns given") } @@ -90,7 +90,7 @@ func NewCustomColumnsPrinterFromSpec(spec string, decoder runtime.Decoder) (*Cus } columns[ix] = Column{Header: colSpec[0], FieldSpec: spec} } - return &CustomColumnsPrinter{Columns: columns, Decoder: decoder}, nil + return &CustomColumnsPrinter{Columns: columns, Decoder: decoder, NoHeaders: noHeaders}, nil } func splitOnWhitespace(line string) []string { @@ -135,7 +135,7 @@ func NewCustomColumnsPrinterFromTemplate(templateReader io.Reader, decoder runti FieldSpec: spec, } } - return &CustomColumnsPrinter{Columns: columns, Decoder: decoder}, nil + return &CustomColumnsPrinter{Columns: columns, Decoder: decoder, NoHeaders: false}, nil } // Column represents a user specified column @@ -150,17 +150,21 @@ type Column struct { // CustomColumnPrinter is a printer that knows how to print arbitrary columns // of data from templates specified in the `Columns` array type CustomColumnsPrinter struct { - Columns []Column - Decoder runtime.Decoder + Columns []Column + Decoder runtime.Decoder + NoHeaders bool } func (s *CustomColumnsPrinter) PrintObj(obj runtime.Object, out io.Writer) error { w := tabwriter.NewWriter(out, columnwidth, tabwidth, padding, padding_character, flags) - headers := make([]string, len(s.Columns)) - for ix := range s.Columns { - headers[ix] = s.Columns[ix].Header + + if !s.NoHeaders { + headers := make([]string, len(s.Columns)) + for ix := range s.Columns { + headers[ix] = s.Columns[ix].Header + } + fmt.Fprintln(w, strings.Join(headers, "\t")) } - fmt.Fprintln(w, strings.Join(headers, "\t")) parsers := make([]*jsonpath.JSONPath, len(s.Columns)) for ix := range s.Columns { parsers[ix] = jsonpath.New(fmt.Sprintf("column%d", ix)) diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/describe.go b/vendor/k8s.io/kubernetes/pkg/kubectl/describe.go index 487f81b6c..f67e949c8 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/describe.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/describe.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -42,12 +42,12 @@ import ( clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" adapter "k8s.io/kubernetes/pkg/client/unversioned/adapters/internalclientset" + deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util" "k8s.io/kubernetes/pkg/fieldpath" "k8s.io/kubernetes/pkg/fields" - qosutil "k8s.io/kubernetes/pkg/kubelet/qos/util" + "k8s.io/kubernetes/pkg/kubelet/qos" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/types" - deploymentutil "k8s.io/kubernetes/pkg/util/deployment" "k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/sets" ) @@ -540,7 +540,7 @@ func describePod(pod *api.Pod, events *api.EventList) (string, error) { } } describeVolumes(pod.Spec.Volumes, out, "") - fmt.Fprintf(out, "QoS Tier:\t%s\n", qosutil.GetPodQos(pod)) + fmt.Fprintf(out, "QoS Class:\t%s\n", qos.GetPodQOS(pod)) if events != nil { DescribeEvents(events, out) } @@ -549,7 +549,7 @@ func describePod(pod *api.Pod, events *api.EventList) (string, error) { } func printControllers(annotation map[string]string) string { - value, ok := annotation["kubernetes.io/created-by"] + value, ok := annotation[api.CreatedByAnnotation] if ok { var r api.SerializedReference err := json.Unmarshal([]byte(value), &r) @@ -887,7 +887,28 @@ func describeContainers(label string, containers []api.Container, containerStatu probe := DescribeProbe(container.ReadinessProbe) fmt.Fprintf(out, " Readiness:\t%s\n", probe) } + none := "" + if len(container.VolumeMounts) == 0 { + none = "\t" + } + + fmt.Fprintf(out, " Volume Mounts:%s\n", none) + sort.Sort(SortableVolumeMounts(container.VolumeMounts)) + for _, mount := range container.VolumeMounts { + flags := []string{} + switch { + case mount.ReadOnly: + flags = append(flags, "ro") + case !mount.ReadOnly: + flags = append(flags, "rw") + case len(mount.SubPath) > 0: + flags = append(flags, fmt.Sprintf("path=%q", mount.SubPath)) + } + fmt.Fprintf(out, " %s from %s (%s)\n", mount.MountPath, mount.Name, strings.Join(flags, ",")) + } + + none = "" if len(container.Env) == 0 { none = "\t" } @@ -1846,7 +1867,7 @@ func describeNodeResource(nodeNonTerminatedPodsList *api.PodList, node *api.Node memoryReq.String(), int64(fractionMemoryReq), memoryLimit.String(), int64(fractionMemoryLimit)) } - fmt.Fprint(out, "Allocated resources:\n (Total limits may be over 100 percent, i.e., overcommitted. More info: http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md)\n CPU Requests\tCPU Limits\tMemory Requests\tMemory Limits\n") + fmt.Fprint(out, "Allocated resources:\n (Total limits may be over 100 percent, i.e., overcommitted.\n CPU Requests\tCPU Limits\tMemory Requests\tMemory Limits\n") fmt.Fprint(out, " ------------\t----------\t---------------\t-------------\n") reqs, limits, err := getPodsTotalRequestsAndLimits(nodeNonTerminatedPodsList) if err != nil { @@ -2116,22 +2137,6 @@ func describeCluster(cluster *federation.Cluster) (string, error) { c.Message) } } - - fmt.Fprintf(out, "Version:\t%s\n", cluster.Status.Version) - - if len(cluster.Status.Capacity) > 0 { - fmt.Fprintf(out, "Capacity:\n") - for resource, value := range cluster.Status.Capacity { - fmt.Fprintf(out, " %s:\t%s\n", resource, value.String()) - } - } - - if len(cluster.Status.Allocatable) > 0 { - fmt.Fprintf(out, "Allocatable:\n") - for resource, value := range cluster.Status.Allocatable { - fmt.Fprintf(out, " %s:\t%s\n", resource, value.String()) - } - } return nil }) } diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/doc.go b/vendor/k8s.io/kubernetes/pkg/kubectl/doc.go index cc34fba7d..d1516ebb7 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/explain.go b/vendor/k8s.io/kubernetes/pkg/kubectl/explain.go index d8b9a1472..dd85a7f36 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/explain.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/explain.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/generate.go b/vendor/k8s.io/kubernetes/pkg/kubectl/generate.go index ea254bcb5..e1ffe370e 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/generate.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/generate.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/history.go b/vendor/k8s.io/kubernetes/pkg/kubectl/history.go index 0e81ebf28..067eb2f43 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/history.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/history.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util" "k8s.io/kubernetes/pkg/runtime" - deploymentutil "k8s.io/kubernetes/pkg/util/deployment" sliceutil "k8s.io/kubernetes/pkg/util/slice" ) diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/interfaces.go b/vendor/k8s.io/kubernetes/pkg/kubectl/interfaces.go index 8f1e6f197..f8acb1ea0 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/interfaces.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/kubectl.go b/vendor/k8s.io/kubernetes/pkg/kubectl/kubectl.go index 9f5cb22ff..dfbc77c5d 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/kubectl.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/kubectl.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -31,11 +31,11 @@ import ( const ( kubectlAnnotationPrefix = "kubectl.kubernetes.io/" // TODO: auto-generate this - PossibleResourceTypes = `Possible resource types include (case insensitive): pods (po), services (svc), deployments, -replicasets (rs), replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits), -persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota), namespaces (ns), -serviceaccounts (sa), ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps, -componentstatuses (cs), endpoints (ep), and secrets.` + PossibleResourceTypes = `Possible resource types include (case insensitive): pods (aka 'po'), services (aka 'svc'), deployments, +replicasets (aka 'rs'), replicationcontrollers (aka 'rc'), nodes (aka 'no'), events (aka 'ev'), limitranges (aka 'limits'), +persistentvolumes (aka 'pv'), persistentvolumeclaims (aka 'pvc'), resourcequotas (aka 'quota'), namespaces (aka 'ns'), +serviceaccounts (aka 'sa'), ingresses (aka 'ing'), horizontalpodautoscalers (aka 'hpa'), daemonsets (aka 'ds'), configmaps, +componentstatuses (aka 'cs), endpoints (aka 'ep'), petsets (alpha feature, may be unstable) and secrets.` ) type NamespaceInfo struct { @@ -164,6 +164,19 @@ var shortForms = map[string]string{ "svc": "services", } +// Look-up for resource short forms by value +func ResourceShortFormFor(resource string) (string, bool) { + var alias string + exists := false + for k, val := range shortForms { + if val == resource { + alias = k + exists = true + } + } + return alias, exists +} + // expandResourceShortcut will return the expanded version of resource // (something that a pkg/api/meta.RESTMapper can understand), if it is // indeed a shortcut. Otherwise, will return resource unmodified. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/namespace.go b/vendor/k8s.io/kubernetes/pkg/kubectl/namespace.go index c6011d38b..6d58c226e 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/namespace.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/proxy_server.go b/vendor/k8s.io/kubernetes/pkg/kubectl/proxy_server.go index 082b542fc..733a3f90f 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/proxy_server.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/proxy_server.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/builder.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/builder.go index ae19557fd..9c32fc6a9 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/builder.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/builder.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -688,6 +688,9 @@ func (b *Builder) visitorResult() *Result { return &Result{singular: singular, visitor: visitors, sources: b.paths} } + if len(b.resources) != 0 { + return &Result{err: fmt.Errorf("resource(s) were provided, but no name, label selector, or --all flag specified")} + } return &Result{err: fmt.Errorf("you must provide one or more resources by argument or filename (%s)", strings.Join(InputExtensions, "|"))} } diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/doc.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/doc.go index 05b35cfdd..a0e22e7cf 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/helper.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/helper.go index 849a6c040..6b5f8d639 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/helper.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/helper.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/interfaces.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/interfaces.go index 2639a61ec..7a872eb2e 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/interfaces.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/mapper.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/mapper.go index 1ca922a05..fe0f315ab 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/mapper.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/mapper.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/result.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/result.go index 562fc0cc3..7e73d75a2 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/result.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/result.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/selector.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/selector.go index 047a814ae..bf9e04950 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/selector.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/selector.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -50,6 +50,15 @@ func (r *Selector) Visit(fn VisitorFunc) error { list, err := NewHelper(r.Client, r.Mapping).List(r.Namespace, r.ResourceMapping().GroupVersionKind.GroupVersion().String(), r.Selector, r.Export) if err != nil { if errors.IsBadRequest(err) || errors.IsNotFound(err) { + if se, ok := err.(*errors.StatusError); ok { + // modify the message without hiding this is an API error + if r.Selector.Empty() { + se.ErrStatus.Message = fmt.Sprintf("Unable to list %q: %v", r.Mapping.Resource, se.ErrStatus.Message) + } else { + se.ErrStatus.Message = fmt.Sprintf("Unable to find %q that match the selector %q: %v", r.Mapping.Resource, r.Selector, se.ErrStatus.Message) + } + return se + } if r.Selector.Empty() { return fmt.Errorf("Unable to list %q: %v", r.Mapping.Resource, err) } else { diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/visitor.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/visitor.go index 2430b312d..a643925d3 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource/visitor.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource/visitor.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/resource_printer.go b/vendor/k8s.io/kubernetes/pkg/kubectl/resource_printer.go index 39c65fcfb..2e046f9e2 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/resource_printer.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/resource_printer.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -62,7 +62,7 @@ const ( // is agnostic to schema versions, so you must send arguments to PrintObj in the // version you wish them to be shown using a VersionedPrinter (typically when // generic is true). -func GetPrinter(format, formatArgument string) (ResourcePrinter, bool, error) { +func GetPrinter(format, formatArgument string, noHeaders bool) (ResourcePrinter, bool, error) { var printer ResourcePrinter switch format { case "json": @@ -119,7 +119,7 @@ func GetPrinter(format, formatArgument string) (ResourcePrinter, bool, error) { } case "custom-columns": var err error - if printer, err = NewCustomColumnsPrinterFromSpec(formatArgument, api.Codecs.UniversalDecoder()); err != nil { + if printer, err = NewCustomColumnsPrinterFromSpec(formatArgument, api.Codecs.UniversalDecoder(), noHeaders); err != nil { return nil, false, err } case "custom-columns-file": @@ -322,10 +322,12 @@ type handlerEntry struct { type PrintOptions struct { NoHeaders bool WithNamespace bool + WithKind bool Wide bool ShowAll bool ShowLabels bool AbsoluteTimestamps bool + KindName string ColumnLabels []string } @@ -335,7 +337,7 @@ type PrintOptions struct { // received from watches. type HumanReadablePrinter struct { handlerMap map[reflect.Type]*handlerEntry - options PrintOptions + Options PrintOptions lastType reflect.Type } @@ -343,9 +345,11 @@ type HumanReadablePrinter struct { func NewHumanReadablePrinter(noHeaders, withNamespace bool, wide bool, showAll bool, showLabels bool, absoluteTimestamps bool, columnLabels []string) *HumanReadablePrinter { printer := &HumanReadablePrinter{ handlerMap: make(map[reflect.Type]*handlerEntry), - options: PrintOptions{ + Options: PrintOptions{ NoHeaders: noHeaders, WithNamespace: withNamespace, + WithKind: false, + KindName: "", Wide: wide, ShowAll: showAll, ShowLabels: showLabels, @@ -599,6 +603,11 @@ func printPod(pod *api.Pod, w io.Writer, options PrintOptions) error { func printPodBase(pod *api.Pod, w io.Writer, options PrintOptions) error { name := pod.Name namespace := pod.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } restarts := 0 totalContainers := len(pod.Spec.Containers) @@ -616,6 +625,7 @@ func printPodBase(pod *api.Pod, w io.Writer, options PrintOptions) error { initializing := false for i := range pod.Status.InitContainerStatuses { container := pod.Status.InitContainerStatuses[i] + restarts += int(container.RestartCount) switch { case container.State.Terminated != nil && container.State.Terminated.ExitCode == 0: continue @@ -641,6 +651,7 @@ func printPodBase(pod *api.Pod, w io.Writer, options PrintOptions) error { break } if !initializing { + restarts = 0 for i := len(pod.Status.ContainerStatuses) - 1; i >= 0; i-- { container := pod.Status.ContainerStatuses[i] @@ -716,6 +727,11 @@ func printPodList(podList *api.PodList, w io.Writer, options PrintOptions) error func printPodTemplate(pod *api.PodTemplate, w io.Writer, options PrintOptions) error { name := pod.Name namespace := pod.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } containers := pod.Template.Spec.Containers @@ -757,6 +773,11 @@ func printReplicationController(controller *api.ReplicationController, w io.Writ name := controller.Name namespace := controller.Namespace containers := controller.Spec.Template.Spec.Containers + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -806,6 +827,11 @@ func printReplicaSet(rs *extensions.ReplicaSet, w io.Writer, options PrintOption name := rs.Name namespace := rs.Namespace containers := rs.Spec.Template.Spec.Containers + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -851,6 +877,11 @@ func printReplicaSetList(list *extensions.ReplicaSetList, w io.Writer, options P } func printCluster(c *federation.Cluster, w io.Writer, options PrintOptions) error { + name := c.Name + kind := options.KindName + if options.WithKind { + name = kind + "/" + name + } var statuses []string for _, condition := range c.Status.Conditions { if condition.Status == api.ConditionTrue { @@ -863,10 +894,9 @@ func printCluster(c *federation.Cluster, w io.Writer, options PrintOptions) erro statuses = append(statuses, "Unknown") } - if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", - c.Name, + if _, err := fmt.Fprintf(w, "%s\t%s\t%s\n", + name, strings.Join(statuses, ","), - c.Status.Version, translateTimestamp(c.CreationTimestamp), ); err != nil { return err @@ -886,6 +916,11 @@ func printJob(job *batch.Job, w io.Writer, options PrintOptions) error { name := job.Name namespace := job.Namespace containers := job.Spec.Template.Spec.Containers + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1004,6 +1039,11 @@ func printService(svc *api.Service, w io.Writer, options PrintOptions) error { internalIP := svc.Spec.ClusterIP externalIP := getServiceExternalIP(svc, options.Wide) + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1080,6 +1120,11 @@ func formatPorts(tls []extensions.IngressTLS) string { func printIngress(ingress *extensions.Ingress, w io.Writer, options PrintOptions) error { name := ingress.Name namespace := ingress.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1119,6 +1164,11 @@ func printPetSet(ps *apps.PetSet, w io.Writer, options PrintOptions) error { name := ps.Name namespace := ps.Namespace containers := ps.Spec.Template.Spec.Containers + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1165,6 +1215,11 @@ func printPetSetList(petSetList *apps.PetSetList, w io.Writer, options PrintOpti func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options PrintOptions) error { name := ds.Name namespace := ds.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } containers := ds.Spec.Template.Spec.Containers @@ -1220,6 +1275,11 @@ func printDaemonSetList(list *extensions.DaemonSetList, w io.Writer, options Pri func printEndpoints(endpoints *api.Endpoints, w io.Writer, options PrintOptions) error { name := endpoints.Name namespace := endpoints.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1246,11 +1306,17 @@ func printEndpointsList(list *api.EndpointsList, w io.Writer, options PrintOptio } func printNamespace(item *api.Namespace, w io.Writer, options PrintOptions) error { + name := item.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { return fmt.Errorf("namespace is not namespaced") } - if _, err := fmt.Fprintf(w, "%s\t%s\t%s", item.Name, item.Status.Phase, translateTimestamp(item.CreationTimestamp)); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s", name, item.Status.Phase, translateTimestamp(item.CreationTimestamp)); err != nil { return err } if _, err := fmt.Fprint(w, AppendLabels(item.Labels, options.ColumnLabels)); err != nil { @@ -1272,6 +1338,11 @@ func printNamespaceList(list *api.NamespaceList, w io.Writer, options PrintOptio func printSecret(item *api.Secret, w io.Writer, options PrintOptions) error { name := item.Name namespace := item.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1301,6 +1372,11 @@ func printSecretList(list *api.SecretList, w io.Writer, options PrintOptions) er func printServiceAccount(item *api.ServiceAccount, w io.Writer, options PrintOptions) error { name := item.Name namespace := item.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1328,6 +1404,12 @@ func printServiceAccountList(list *api.ServiceAccountList, w io.Writer, options } func printNode(node *api.Node, w io.Writer, options PrintOptions) error { + name := node.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { return fmt.Errorf("node is not namespaced") } @@ -1354,7 +1436,7 @@ func printNode(node *api.Node, w io.Writer, options PrintOptions) error { status = append(status, "SchedulingDisabled") } - if _, err := fmt.Fprintf(w, "%s\t%s\t%s", node.Name, strings.Join(status, ","), translateTimestamp(node.CreationTimestamp)); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s", name, strings.Join(status, ","), translateTimestamp(node.CreationTimestamp)); err != nil { return err } // Display caller specify column labels first. @@ -1375,10 +1457,15 @@ func printNodeList(list *api.NodeList, w io.Writer, options PrintOptions) error } func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, options PrintOptions) error { + name := pv.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { return fmt.Errorf("persistentVolume is not namespaced") } - name := pv.Name claimRefUID := "" if pv.Spec.ClaimRef != nil { @@ -1421,6 +1508,11 @@ func printPersistentVolumeList(list *api.PersistentVolumeList, w io.Writer, opti func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, options PrintOptions) error { name := pvc.Name namespace := pvc.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1458,7 +1550,13 @@ func printPersistentVolumeClaimList(list *api.PersistentVolumeClaimList, w io.Wr } func printEvent(event *api.Event, w io.Writer, options PrintOptions) error { + name := event.InvolvedObject.Name namespace := event.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { return err @@ -1480,7 +1578,7 @@ func printEvent(event *api.Event, w io.Writer, options PrintOptions) error { LastTimestamp, FirstTimestamp, event.Count, - event.InvolvedObject.Name, + name, event.InvolvedObject.Kind, event.InvolvedObject.FieldPath, event.Type, @@ -1524,6 +1622,12 @@ func printLimitRangeList(list *api.LimitRangeList, w io.Writer, options PrintOpt // printObjectMeta prints the object metadata of a given resource. func printObjectMeta(meta api.ObjectMeta, w io.Writer, options PrintOptions, namespaced bool) error { + name := meta.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if namespaced && options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", meta.Namespace); err != nil { return err @@ -1532,7 +1636,7 @@ func printObjectMeta(meta api.ObjectMeta, w io.Writer, options PrintOptions, nam if _, err := fmt.Fprintf( w, "%s\t%s", - meta.Name, + name, translateTimestamp(meta.CreationTimestamp), ); err != nil { return err @@ -1615,6 +1719,12 @@ func printClusterRoleBindingList(list *rbac.ClusterRoleBindingList, w io.Writer, } func printComponentStatus(item *api.ComponentStatus, w io.Writer, options PrintOptions) error { + name := item.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { return fmt.Errorf("componentStatus is not namespaced") } @@ -1634,7 +1744,7 @@ func printComponentStatus(item *api.ComponentStatus, w io.Writer, options PrintO } } - if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s", item.Name, status, message, error); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s", name, status, message, error); err != nil { return err } if _, err := fmt.Fprint(w, AppendLabels(item.Labels, options.ColumnLabels)); err != nil { @@ -1655,13 +1765,20 @@ func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, option } func printThirdPartyResource(rsrc *extensions.ThirdPartyResource, w io.Writer, options PrintOptions) error { + name := rsrc.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } + versions := make([]string, len(rsrc.Versions)) for ix := range rsrc.Versions { version := &rsrc.Versions[ix] versions[ix] = fmt.Sprintf("%s", version.Name) } versionsString := strings.Join(versions, ",") - if _, err := fmt.Fprintf(w, "%s\t%s\t%s\n", rsrc.Name, rsrc.Description, versionsString); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s\n", name, rsrc.Description, versionsString); err != nil { return err } return nil @@ -1685,12 +1802,19 @@ func truncate(str string, maxLen int) string { } func printThirdPartyResourceData(rsrc *extensions.ThirdPartyResourceData, w io.Writer, options PrintOptions) error { + name := rsrc.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } + l := labels.FormatLabels(rsrc.Labels) truncateCols := 50 if options.Wide { truncateCols = 100 } - if _, err := fmt.Fprintf(w, "%s\t%s\t%s\n", rsrc.Name, l, truncate(string(rsrc.Data), truncateCols)); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s\n", name, l, truncate(string(rsrc.Data), truncateCols)); err != nil { return err } return nil @@ -1707,6 +1831,12 @@ func printThirdPartyResourceDataList(list *extensions.ThirdPartyResourceDataList } func printDeployment(deployment *extensions.Deployment, w io.Writer, options PrintOptions) error { + name := deployment.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", deployment.Namespace); err != nil { return err @@ -1718,7 +1848,7 @@ func printDeployment(deployment *extensions.Deployment, w io.Writer, options Pri updatedReplicas := deployment.Status.UpdatedReplicas availableReplicas := deployment.Status.AvailableReplicas age := translateTimestamp(deployment.CreationTimestamp) - if _, err := fmt.Fprintf(w, "%s\t%d\t%d\t%d\t%d\t%s", deployment.Name, desiredReplicas, currentReplicas, updatedReplicas, availableReplicas, age); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%d\t%d\t%d\t%d\t%s", name, desiredReplicas, currentReplicas, updatedReplicas, availableReplicas, age); err != nil { return err } if _, err := fmt.Fprint(w, AppendLabels(deployment.Labels, options.ColumnLabels)); err != nil { @@ -1740,6 +1870,11 @@ func printDeploymentList(list *extensions.DeploymentList, w io.Writer, options P func printHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, w io.Writer, options PrintOptions) error { namespace := hpa.Namespace name := hpa.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } reference := fmt.Sprintf("%s/%s", hpa.Spec.ScaleTargetRef.Kind, hpa.Spec.ScaleTargetRef.Name) @@ -1756,6 +1891,7 @@ func printHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, w io minPods = fmt.Sprintf("%d", *hpa.Spec.MinReplicas) } maxPods := hpa.Spec.MaxReplicas + if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { return err @@ -1792,6 +1928,11 @@ func printHorizontalPodAutoscalerList(list *autoscaling.HorizontalPodAutoscalerL func printConfigMap(configMap *api.ConfigMap, w io.Writer, options PrintOptions) error { name := configMap.Name namespace := configMap.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1818,7 +1959,13 @@ func printConfigMapList(list *api.ConfigMapList, w io.Writer, options PrintOptio } func printPodSecurityPolicy(item *extensions.PodSecurityPolicy, w io.Writer, options PrintOptions) error { - _, err := fmt.Fprintf(w, "%s\t%t\t%v\t%s\t%s\t%s\t%s\t%t\t%v\n", item.Name, item.Spec.Privileged, + name := item.Name + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } + _, err := fmt.Fprintf(w, "%s\t%t\t%v\t%s\t%s\t%s\t%s\t%t\t%v\n", name, item.Spec.Privileged, item.Spec.AllowedCapabilities, item.Spec.SELinux.Rule, item.Spec.RunAsUser.Rule, item.Spec.FSGroup.Rule, item.Spec.SupplementalGroups.Rule, item.Spec.ReadOnlyRootFilesystem, item.Spec.Volumes) return err @@ -1837,6 +1984,11 @@ func printPodSecurityPolicyList(list *extensions.PodSecurityPolicyList, w io.Wri func printNetworkPolicy(networkPolicy *extensions.NetworkPolicy, w io.Writer, options PrintOptions) error { name := networkPolicy.Name namespace := networkPolicy.Namespace + kind := options.KindName + + if options.WithKind { + name = kind + "/" + name + } if options.WithNamespace { if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { @@ -1983,18 +2135,18 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er } t := reflect.TypeOf(obj) if handler := h.handlerMap[t]; handler != nil { - if !h.options.NoHeaders && t != h.lastType { - headers := append(handler.columns, formatWideHeaders(h.options.Wide, t)...) - headers = append(headers, formatLabelHeaders(h.options.ColumnLabels)...) + if !h.Options.NoHeaders && t != h.lastType { + headers := append(handler.columns, formatWideHeaders(h.Options.Wide, t)...) + headers = append(headers, formatLabelHeaders(h.Options.ColumnLabels)...) // LABELS is always the last column. - headers = append(headers, formatShowLabelsHeader(h.options.ShowLabels, t)...) - if h.options.WithNamespace { + headers = append(headers, formatShowLabelsHeader(h.Options.ShowLabels, t)...) + if h.Options.WithNamespace { headers = append(withNamespacePrefixColumns, headers...) } h.printHeader(headers, w) h.lastType = t } - args := []reflect.Value{reflect.ValueOf(obj), reflect.ValueOf(w), reflect.ValueOf(h.options)} + args := []reflect.Value{reflect.ValueOf(obj), reflect.ValueOf(w), reflect.ValueOf(h.Options)} resultValue := handler.printFunc.Call(args)[0] if resultValue.IsNil() { return nil diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/rollback.go b/vendor/k8s.io/kubernetes/pkg/kubectl/rollback.go index 2e4f92b30..f5294b042 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/rollback.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/rollback.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,14 +26,14 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" client "k8s.io/kubernetes/pkg/client/unversioned" + deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util" "k8s.io/kubernetes/pkg/runtime" - deploymentutil "k8s.io/kubernetes/pkg/util/deployment" "k8s.io/kubernetes/pkg/watch" ) // Rollbacker provides an interface for resources that can be rolled back. type Rollbacker interface { - Rollback(namespace, name string, updatedAnnotations map[string]string, toRevision int64, obj runtime.Object) (string, error) + Rollback(obj runtime.Object, updatedAnnotations map[string]string, toRevision int64) (string, error) } func RollbackerFor(kind unversioned.GroupKind, c client.Interface) (Rollbacker, error) { @@ -48,13 +48,16 @@ type DeploymentRollbacker struct { c client.Interface } -func (r *DeploymentRollbacker) Rollback(namespace, name string, updatedAnnotations map[string]string, toRevision int64, obj runtime.Object) (string, error) { - d := obj.(*extensions.Deployment) +func (r *DeploymentRollbacker) Rollback(obj runtime.Object, updatedAnnotations map[string]string, toRevision int64) (string, error) { + d, ok := obj.(*extensions.Deployment) + if !ok { + return "", fmt.Errorf("passed object is not a Deployment: %#v", obj) + } if d.Spec.Paused { - return "", fmt.Errorf("you cannot rollback a paused deployment; resume it first with 'kubectl rollout resume' and try again") + return "", fmt.Errorf("you cannot rollback a paused deployment; resume it first with 'kubectl rollout resume deployment/%s' and try again", d.Name) } deploymentRollback := &extensions.DeploymentRollback{ - Name: name, + Name: d.Name, UpdatedAnnotations: updatedAnnotations, RollbackTo: extensions.RollbackConfig{ Revision: toRevision, @@ -63,16 +66,16 @@ func (r *DeploymentRollbacker) Rollback(namespace, name string, updatedAnnotatio result := "" // Get current events - events, err := r.c.Events(namespace).List(api.ListOptions{}) + events, err := r.c.Events(d.Namespace).List(api.ListOptions{}) if err != nil { return result, err } // Do the rollback - if err := r.c.Extensions().Deployments(namespace).Rollback(deploymentRollback); err != nil { + if err := r.c.Extensions().Deployments(d.Namespace).Rollback(deploymentRollback); err != nil { return result, err } // Watch for the changes of events - watch, err := r.c.Events(namespace).Watch(api.ListOptions{Watch: true, ResourceVersion: events.ResourceVersion}) + watch, err := r.c.Events(d.Namespace).Watch(api.ListOptions{Watch: true, ResourceVersion: events.ResourceVersion}) if err != nil { return result, err } diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go b/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go index ea5bb887c..2872b1ef6 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -26,10 +26,11 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" + "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" + deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util/deployment" "k8s.io/kubernetes/pkg/util/integer" "k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/wait" @@ -58,6 +59,8 @@ type RollingUpdaterConfig struct { Interval time.Duration // Timeout is the time to wait for controller updates before giving up. Timeout time.Duration + // MinReadySeconds is the number of seconds to wait after the pods are ready + MinReadySeconds int32 // CleanupPolicy defines the cleanup action to take after the deployment is // complete. CleanupPolicy RollingUpdaterCleanupPolicy @@ -118,7 +121,9 @@ type RollingUpdater struct { // cleanup performs post deployment cleanup tasks for newRc and oldRc. cleanup func(oldRc, newRc *api.ReplicationController, config *RollingUpdaterConfig) error // getReadyPods returns the amount of old and new ready pods. - getReadyPods func(oldRc, newRc *api.ReplicationController) (int32, int32, error) + getReadyPods func(oldRc, newRc *api.ReplicationController, minReadySeconds int32) (int32, int32, error) + // nowFn returns the current time used to calculate the minReadySeconds + nowFn func() unversioned.Time } // NewRollingUpdater creates a RollingUpdater from a client. @@ -132,6 +137,7 @@ func NewRollingUpdater(namespace string, client client.Interface) *RollingUpdate updater.getOrCreateTargetController = updater.getOrCreateTargetControllerWithClient updater.getReadyPods = updater.readyPods updater.cleanup = updater.cleanupWithClients + updater.nowFn = func() unversioned.Time { return unversioned.Now() } return updater } @@ -187,19 +193,20 @@ func (r *RollingUpdater) Update(config *RollingUpdaterConfig) error { if err != nil { return err } - if existing.Annotations == nil { - existing.Annotations = map[string]string{} + originReplicas := strconv.Itoa(int(existing.Spec.Replicas)) + applyUpdate := func(rc *api.ReplicationController) { + if rc.Annotations == nil { + rc.Annotations = map[string]string{} + } + rc.Annotations[originalReplicasAnnotation] = originReplicas } - existing.Annotations[originalReplicasAnnotation] = strconv.Itoa(int(existing.Spec.Replicas)) - updated, err := r.c.ReplicationControllers(existing.Namespace).Update(existing) - if err != nil { + if oldRc, err = updateRcWithRetries(r.c, existing.Namespace, existing, applyUpdate); err != nil { return err } - oldRc = updated } // maxSurge is the maximum scaling increment and maxUnavailable are the maximum pods // that can be unavailable during a rollout. - maxSurge, maxUnavailable, err := deployment.ResolveFenceposts(&config.MaxSurge, &config.MaxUnavailable, desired) + maxSurge, maxUnavailable, err := deploymentutil.ResolveFenceposts(&config.MaxSurge, &config.MaxUnavailable, desired) if err != nil { return err } @@ -339,7 +346,7 @@ func (r *RollingUpdater) scaleDown(newRc, oldRc *api.ReplicationController, desi // Get ready pods. We shouldn't block, otherwise in case both old and new // pods are unavailable then the rolling update process blocks. // Timeout-wise we are already covered by the progress check. - _, newAvailable, err := r.getReadyPods(oldRc, newRc) + _, newAvailable, err := r.getReadyPods(oldRc, newRc, config.MinReadySeconds) if err != nil { return nil, err } @@ -396,10 +403,13 @@ func (r *RollingUpdater) scaleAndWaitWithScaler(rc *api.ReplicationController, r // readyPods returns the old and new ready counts for their pods. // If a pod is observed as being ready, it's considered ready even // if it later becomes notReady. -func (r *RollingUpdater) readyPods(oldRc, newRc *api.ReplicationController) (int32, int32, error) { +func (r *RollingUpdater) readyPods(oldRc, newRc *api.ReplicationController, minReadySeconds int32) (int32, int32, error) { controllers := []*api.ReplicationController{oldRc, newRc} oldReady := int32(0) newReady := int32(0) + if r.nowFn == nil { + r.nowFn = func() unversioned.Time { return unversioned.Now() } + } for i := range controllers { controller := controllers[i] @@ -410,13 +420,14 @@ func (r *RollingUpdater) readyPods(oldRc, newRc *api.ReplicationController) (int return 0, 0, err } for _, pod := range pods.Items { - if api.IsPodReady(&pod) { - switch controller.Name { - case oldRc.Name: - oldReady++ - case newRc.Name: - newReady++ - } + if !deploymentutil.IsPodAvailable(&pod, minReadySeconds, r.nowFn().Time) { + continue + } + switch controller.Name { + case oldRc.Name: + oldReady++ + case newRc.Name: + newReady++ } } } @@ -482,13 +493,14 @@ func (r *RollingUpdater) cleanupWithClients(oldRc, newRc *api.ReplicationControl if err != nil { return err } - delete(newRc.Annotations, sourceIdAnnotation) - delete(newRc.Annotations, desiredReplicasAnnotation) - - newRc, err = r.c.ReplicationControllers(r.ns).Update(newRc) - if err != nil { + applyUpdate := func(rc *api.ReplicationController) { + delete(rc.Annotations, sourceIdAnnotation) + delete(rc.Annotations, desiredReplicasAnnotation) + } + if newRc, err = updateRcWithRetries(r.c, r.ns, newRc, applyUpdate); err != nil { return err } + if err = wait.Poll(config.Interval, config.Timeout, client.ControllerHasDesiredReplicas(r.c, newRc)); err != nil { return err } @@ -643,27 +655,29 @@ func SetNextControllerAnnotation(rc *api.ReplicationController, name string) { } func UpdateExistingReplicationController(c client.Interface, oldRc *api.ReplicationController, namespace, newName, deploymentKey, deploymentValue string, out io.Writer) (*api.ReplicationController, error) { - SetNextControllerAnnotation(oldRc, newName) if _, found := oldRc.Spec.Selector[deploymentKey]; !found { + SetNextControllerAnnotation(oldRc, newName) return AddDeploymentKeyToReplicationController(oldRc, c, deploymentKey, deploymentValue, namespace, out) } else { // If we didn't need to update the controller for the deployment key, we still need to write // the "next" controller. - return c.ReplicationControllers(namespace).Update(oldRc) + applyUpdate := func(rc *api.ReplicationController) { + SetNextControllerAnnotation(rc, newName) + } + return updateRcWithRetries(c, namespace, oldRc, applyUpdate) } } -const MaxRetries = 3 - func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, client client.Interface, deploymentKey, deploymentValue, namespace string, out io.Writer) (*api.ReplicationController, error) { var err error // First, update the template label. This ensures that any newly created pods will have the new label - if oldRc, err = updateWithRetries(client.ReplicationControllers(namespace), oldRc, func(rc *api.ReplicationController) { + applyUpdate := func(rc *api.ReplicationController) { if rc.Spec.Template.Labels == nil { rc.Spec.Template.Labels = map[string]string{} } rc.Spec.Template.Labels[deploymentKey] = deploymentValue - }); err != nil { + } + if oldRc, err = updateRcWithRetries(client, namespace, oldRc, applyUpdate); err != nil { return nil, err } @@ -677,26 +691,16 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c } for ix := range podList.Items { pod := &podList.Items[ix] - if pod.Labels == nil { - pod.Labels = map[string]string{ - deploymentKey: deploymentValue, - } - } else { - pod.Labels[deploymentKey] = deploymentValue - } - err = nil - delay := 3 - for i := 0; i < MaxRetries; i++ { - _, err = client.Pods(namespace).Update(pod) - if err != nil { - fmt.Fprintf(out, "Error updating pod (%v), retrying after %d seconds", err, delay) - time.Sleep(time.Second * time.Duration(delay)) - delay *= delay + applyUpdate := func(p *api.Pod) { + if p.Labels == nil { + p.Labels = map[string]string{ + deploymentKey: deploymentValue, + } } else { - break + p.Labels[deploymentKey] = deploymentValue } } - if err != nil { + if pod, err = updatePodWithRetries(client, namespace, pod, applyUpdate); err != nil { return nil, err } } @@ -709,12 +713,11 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c for k, v := range oldRc.Spec.Selector { selectorCopy[k] = v } - oldRc.Spec.Selector[deploymentKey] = deploymentValue - - // Update the selector of the rc so it manages all the pods we updated above - if oldRc, err = updateWithRetries(client.ReplicationControllers(namespace), oldRc, func(rc *api.ReplicationController) { + applyUpdate = func(rc *api.ReplicationController) { rc.Spec.Selector[deploymentKey] = deploymentValue - }); err != nil { + } + // Update the selector of the rc so it manages all the pods we updated above + if oldRc, err = updateRcWithRetries(client, namespace, oldRc, applyUpdate); err != nil { return nil, err } @@ -736,33 +739,72 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c return oldRc, nil } -type updateFunc func(controller *api.ReplicationController) +type updateRcFunc func(controller *api.ReplicationController) -// updateWithRetries updates applies the given rc as an update. -func updateWithRetries(rcClient client.ReplicationControllerInterface, rc *api.ReplicationController, applyUpdate updateFunc) (*api.ReplicationController, error) { - var err error - oldRc := rc - err = wait.Poll(10*time.Millisecond, 1*time.Minute, func() (bool, error) { +// updateRcWithRetries retries updating the given rc on conflict with the following steps: +// 1. Get latest resource +// 2. applyUpdate +// 3. Update the resource +func updateRcWithRetries(c client.Interface, namespace string, rc *api.ReplicationController, applyUpdate updateRcFunc) (*api.ReplicationController, error) { + // Deep copy the rc in case we failed on Get during retry loop + obj, err := api.Scheme.Copy(rc) + if err != nil { + return nil, fmt.Errorf("failed to deep copy rc before updating it: %v", err) + } + oldRc := obj.(*api.ReplicationController) + err = client.RetryOnConflict(client.DefaultBackoff, func() (e error) { // Apply the update, then attempt to push it to the apiserver. applyUpdate(rc) - if rc, err = rcClient.Update(rc); err == nil { + if rc, e = c.ReplicationControllers(namespace).Update(rc); e == nil { // rc contains the latest controller post update - return true, nil + return } + updateErr := e // Update the controller with the latest resource version, if the update failed we // can't trust rc so use oldRc.Name. - if rc, err = rcClient.Get(oldRc.Name); err != nil { + if rc, e = c.ReplicationControllers(namespace).Get(oldRc.Name); e != nil { // The Get failed: Value in rc cannot be trusted. rc = oldRc } - // The Get passed: rc contains the latest controller, expect a poll for the update. - return false, nil + // Only return the error from update + return updateErr }) // If the error is non-nil the returned controller cannot be trusted, if it is nil, the returned // controller contains the applied update. return rc, err } +type updatePodFunc func(controller *api.Pod) + +// updatePodWithRetries retries updating the given pod on conflict with the following steps: +// 1. Get latest resource +// 2. applyUpdate +// 3. Update the resource +func updatePodWithRetries(c client.Interface, namespace string, pod *api.Pod, applyUpdate updatePodFunc) (*api.Pod, error) { + // Deep copy the pod in case we failed on Get during retry loop + obj, err := api.Scheme.Copy(pod) + if err != nil { + return nil, fmt.Errorf("failed to deep copy pod before updating it: %v", err) + } + oldPod := obj.(*api.Pod) + err = client.RetryOnConflict(client.DefaultBackoff, func() (e error) { + // Apply the update, then attempt to push it to the apiserver. + applyUpdate(pod) + if pod, e = c.Pods(namespace).Update(pod); e == nil { + return + } + updateErr := e + if pod, e = c.Pods(namespace).Get(oldPod.Name); e != nil { + pod = oldPod + } + // Only return the error from update + return updateErr + }) + // If the error is non-nil the returned pod cannot be trusted, if it is nil, the returned + // controller contains the applied update. + return pod, err +} + func FindSourceController(r client.ReplicationControllersNamespacer, namespace, name string) (*api.ReplicationController, error) { list, err := r.ReplicationControllers(namespace).List(api.ListOptions{}) if err != nil { diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/rollout_status.go b/vendor/k8s.io/kubernetes/pkg/kubectl/rollout_status.go index dc39865d4..632a98f79 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/rollout_status.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/rollout_status.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/run.go b/vendor/k8s.io/kubernetes/pkg/kubectl/run.go index 4e076c071..0b89b7814 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/run.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/run.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -835,7 +835,10 @@ func parseEnvs(envArray []string) ([]api.EnvVar, error) { } name := env[:pos] value := env[pos+1:] - if len(name) == 0 || !validation.IsCIdentifier(name) || len(value) == 0 { + if len(name) == 0 || len(value) == 0 { + return nil, fmt.Errorf("invalid env: %v", env) + } + if len(validation.IsCIdentifier(name)) != 0 { return nil, fmt.Errorf("invalid env: %v", env) } envVar := api.EnvVar{Name: name, Value: value} @@ -853,7 +856,7 @@ func parseV1Envs(envArray []string) ([]v1.EnvVar, error) { } name := env[:pos] value := env[pos+1:] - if len(name) == 0 || !validation.IsCIdentifier(name) || len(value) == 0 { + if len(name) == 0 || len(validation.IsCIdentifier(name)) != 0 || len(value) == 0 { return nil, fmt.Errorf("invalid env: %v", env) } envVar := v1.EnvVar{Name: name, Value: value} diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/scale.go b/vendor/k8s.io/kubernetes/pkg/kubectl/scale.go index bef93d990..c2e0f3369 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/scale.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -81,7 +81,7 @@ type ScaleErrorType int const ( ScaleGetFailure ScaleErrorType = iota ScaleUpdateFailure - ScaleUpdateInvalidFailure + ScaleUpdateConflictFailure ) // A ScaleError is returned when a scale request passes @@ -115,11 +115,8 @@ func ScaleCondition(r Scaler, precondition *ScalePrecondition, namespace, name s case nil: return true, nil case ScaleError: - // if it's invalid we shouldn't keep waiting - if e.FailureType == ScaleUpdateInvalidFailure { - return false, err - } - if e.FailureType == ScaleUpdateFailure { + // Retry only on update conflicts. + if e.FailureType == ScaleUpdateConflictFailure { return false, nil } } @@ -153,10 +150,9 @@ func (scaler *ReplicationControllerScaler) ScaleSimple(namespace, name string, p } } controller.Spec.Replicas = int32(newSize) - // TODO: do retry on 409 errors here? if _, err := scaler.c.ReplicationControllers(namespace).Update(controller); err != nil { - if errors.IsInvalid(err) { - return ScaleError{ScaleUpdateInvalidFailure, controller.ResourceVersion, err} + if errors.IsConflict(err) { + return ScaleError{ScaleUpdateConflictFailure, controller.ResourceVersion, err} } return ScaleError{ScaleUpdateFailure, controller.ResourceVersion, err} } @@ -183,8 +179,11 @@ func (scaler *ReplicationControllerScaler) Scale(namespace, name string, newSize if err != nil { return err } - return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, - client.ControllerHasDesiredReplicas(scaler.c, rc)) + err = wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, client.ControllerHasDesiredReplicas(scaler.c, rc)) + if err == wait.ErrWaitTimeout { + return fmt.Errorf("timed out waiting for %q to be synced", name) + } + return err } return nil } @@ -215,10 +214,9 @@ func (scaler *ReplicaSetScaler) ScaleSimple(namespace, name string, precondition } } rs.Spec.Replicas = int32(newSize) - // TODO: do retry on 409 errors here? if _, err := scaler.c.ReplicaSets(namespace).Update(rs); err != nil { - if errors.IsInvalid(err) { - return ScaleError{ScaleUpdateInvalidFailure, rs.ResourceVersion, err} + if errors.IsConflict(err) { + return ScaleError{ScaleUpdateConflictFailure, rs.ResourceVersion, err} } return ScaleError{ScaleUpdateFailure, rs.ResourceVersion, err} } @@ -245,8 +243,11 @@ func (scaler *ReplicaSetScaler) Scale(namespace, name string, newSize uint, prec if err != nil { return err } - return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, - client.ReplicaSetHasDesiredReplicas(scaler.c, rs)) + err = wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, client.ReplicaSetHasDesiredReplicas(scaler.c, rs)) + if err == wait.ErrWaitTimeout { + return fmt.Errorf("timed out waiting for %q to be synced", name) + } + return err } return nil } @@ -283,8 +284,8 @@ func (scaler *JobScaler) ScaleSimple(namespace, name string, preconditions *Scal parallelism := int32(newSize) job.Spec.Parallelism = ¶llelism if _, err := scaler.c.Jobs(namespace).Update(job); err != nil { - if errors.IsInvalid(err) { - return ScaleError{ScaleUpdateInvalidFailure, job.ResourceVersion, err} + if errors.IsConflict(err) { + return ScaleError{ScaleUpdateConflictFailure, job.ResourceVersion, err} } return ScaleError{ScaleUpdateFailure, job.ResourceVersion, err} } @@ -311,8 +312,11 @@ func (scaler *JobScaler) Scale(namespace, name string, newSize uint, preconditio if err != nil { return err } - return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, - client.JobHasDesiredParallelism(scaler.c, job)) + err = wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, client.JobHasDesiredParallelism(scaler.c, job)) + if err == wait.ErrWaitTimeout { + return fmt.Errorf("timed out waiting for %q to be synced", name) + } + return err } return nil } @@ -348,8 +352,8 @@ func (scaler *DeploymentScaler) ScaleSimple(namespace, name string, precondition // For now I'm falling back to regular Deployment update operation. deployment.Spec.Replicas = int32(newSize) if _, err := scaler.c.Deployments(namespace).Update(deployment); err != nil { - if errors.IsInvalid(err) { - return ScaleError{ScaleUpdateInvalidFailure, deployment.ResourceVersion, err} + if errors.IsConflict(err) { + return ScaleError{ScaleUpdateConflictFailure, deployment.ResourceVersion, err} } return ScaleError{ScaleUpdateFailure, deployment.ResourceVersion, err} } @@ -375,8 +379,11 @@ func (scaler *DeploymentScaler) Scale(namespace, name string, newSize uint, prec if err != nil { return err } - return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, - client.DeploymentHasDesiredReplicas(scaler.c, deployment)) + err = wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, client.DeploymentHasDesiredReplicas(scaler.c, deployment)) + if err == wait.ErrWaitTimeout { + return fmt.Errorf("timed out waiting for %q to be synced", name) + } + return err } return nil } diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/secret.go b/vendor/k8s.io/kubernetes/pkg/kubectl/secret.go index e5b7cc33e..cc3271197 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/secret.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -24,8 +24,8 @@ import ( "strings" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/util/validation" ) // SecretGeneratorV1 supports stable generation of an opaque secret @@ -196,9 +196,10 @@ func addKeyFromFileToSecret(secret *api.Secret, keyName, filePath string) error } func addKeyFromLiteralToSecret(secret *api.Secret, keyName string, data []byte) error { - if !validation.IsSecretKey(keyName) { - return fmt.Errorf("%v is not a valid key name for a secret", keyName) + if errs := validation.IsConfigMapKey(keyName); len(errs) != 0 { + return fmt.Errorf("%q is not a valid key name for a Secret: %s", keyName, strings.Join(errs, ";")) } + if _, entryExists := secret.Data[keyName]; entryExists { return fmt.Errorf("cannot add key %s, another key by that name already exists: %v.", keyName, secret.Data) } diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_docker_registry.go b/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_docker_registry.go index 773bde386..65615a7fd 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_docker_registry.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_docker_registry.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_tls.go b/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_tls.go index 05061d259..a29af5597 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_tls.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/secret_for_tls.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/service.go b/vendor/k8s.io/kubernetes/pkg/kubectl/service.go index f67b3a11b..891e9de83 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/service.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/service.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/serviceaccount.go b/vendor/k8s.io/kubernetes/pkg/kubectl/serviceaccount.go index 2be08dd2d..1a7e256da 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/serviceaccount.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_event_list.go b/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_event_list.go index 568c46d6d..b8db7fad2 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_event_list.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_event_list.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_resource_name_list.go b/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_resource_name_list.go index 98c67344a..aad1d8074 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_resource_name_list.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/sorted_resource_name_list.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -20,7 +20,7 @@ import ( "sort" "k8s.io/kubernetes/pkg/api" - qosutil "k8s.io/kubernetes/pkg/kubelet/qos/util" + "k8s.io/kubernetes/pkg/kubelet/qos" ) type SortableResourceNames []api.ResourceName @@ -61,8 +61,22 @@ func (list SortableResourceQuotas) Less(i, j int) bool { return list[i].Name < list[j].Name } +type SortableVolumeMounts []api.VolumeMount + +func (list SortableVolumeMounts) Len() int { + return len(list) +} + +func (list SortableVolumeMounts) Swap(i, j int) { + list[i], list[j] = list[j], list[i] +} + +func (list SortableVolumeMounts) Less(i, j int) bool { + return list[i].MountPath < list[j].MountPath +} + // SortedQoSResourceNames returns the sorted resource names of a QoS list. -func SortedQoSResourceNames(list qosutil.QoSList) []api.ResourceName { +func SortedQoSResourceNames(list qos.QOSList) []api.ResourceName { resources := make([]api.ResourceName, 0, len(list)) for res := range list { resources = append(resources, res) diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/sorting_printer.go b/vendor/k8s.io/kubernetes/pkg/kubectl/sorting_printer.go index e95b8a1e7..c2c97f37d 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/sorting_printer.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/sorting_printer.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/stop.go b/vendor/k8s.io/kubernetes/pkg/kubectl/stop.go index d784ef24c..1d3a891bb 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/stop.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/stop.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -28,9 +28,9 @@ import ( "k8s.io/kubernetes/pkg/apis/batch" "k8s.io/kubernetes/pkg/apis/extensions" client "k8s.io/kubernetes/pkg/client/unversioned" + deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util" - deploymentutil "k8s.io/kubernetes/pkg/util/deployment" utilerrors "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/wait" ) diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/version.go b/vendor/k8s.io/kubernetes/pkg/kubectl/version.go index 4c39b3c99..8e32c2dcc 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/version.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/version.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/watchloop.go b/vendor/k8s.io/kubernetes/pkg/kubectl/watchloop.go index d2920dd7d..2f814a61c 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubectl/watchloop.go +++ b/vendor/k8s.io/kubernetes/pkg/kubectl/watchloop.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go index 04a25c907..ebc1cc598 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go index 511e629fa..ad696f361 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -18,7 +18,6 @@ package qos import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/kubelet/qos/util" ) const ( @@ -36,11 +35,11 @@ const ( // and 1000. Containers with higher OOM scores are killed if the system runs out of memory. // See https://lwn.net/Articles/391222/ for more information. func GetContainerOOMScoreAdjust(pod *api.Pod, container *api.Container, memoryCapacity int64) int { - switch util.GetPodQos(pod) { - case util.Guaranteed: + switch GetPodQOS(pod) { + case Guaranteed: // Guaranteed containers should be the last to get killed. return guaranteedOOMScoreAdj - case util.BestEffort: + case BestEffort: return besteffortOOMScoreAdj } diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/qos/util/qos.go b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/qos.go similarity index 86% rename from vendor/k8s.io/kubernetes/pkg/kubelet/qos/util/qos.go rename to vendor/k8s.io/kubernetes/pkg/kubelet/qos/qos.go index 9d7a5786a..2c0d19d04 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/qos/util/qos.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/qos.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -14,19 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -package util +package qos import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" ) -const ( - Guaranteed = "Guaranteed" - Burstable = "Burstable" - BestEffort = "BestEffort" -) - // isResourceGuaranteed returns true if the container's resource requirements are Guaranteed. func isResourceGuaranteed(container *api.Container, resource api.ResourceName) bool { // A container resource is guaranteed if its request == limit. @@ -47,11 +41,11 @@ func isResourceBestEffort(container *api.Container, resource api.ResourceName) b return !hasReq || req.Value() == 0 } -// GetPodQos returns the QoS class of a pod. +// GetPodQOS returns the QoS class of a pod. // A pod is besteffort if none of its containers have specified any requests or limits. // A pod is guaranteed only when requests and limits are specified for all the containers and they are equal. // A pod is burstable if limits and requests do not match across all containers. -func GetPodQos(pod *api.Pod) string { +func GetPodQOS(pod *api.Pod) QOSClass { requests := api.ResourceList{} limits := api.ResourceList{} zeroQuantity := resource.MustParse("0") @@ -105,23 +99,23 @@ func GetPodQos(pod *api.Pod) string { return Burstable } -// QoSList is a set of (resource name, QoS class) pairs. -type QoSList map[api.ResourceName]string +// QOSList is a set of (resource name, QoS class) pairs. +type QOSList map[api.ResourceName]QOSClass -// GetQoS returns a mapping of resource name to QoS class of a container -func GetQoS(container *api.Container) QoSList { - resourceToQoS := QoSList{} +// GetQOS returns a mapping of resource name to QoS class of a container +func GetQOS(container *api.Container) QOSList { + resourceToQOS := QOSList{} for resource := range allResources(container) { switch { case isResourceGuaranteed(container, resource): - resourceToQoS[resource] = Guaranteed + resourceToQOS[resource] = Guaranteed case isResourceBestEffort(container, resource): - resourceToQoS[resource] = BestEffort + resourceToQOS[resource] = BestEffort default: - resourceToQoS[resource] = Burstable + resourceToQOS[resource] = Burstable } } - return resourceToQoS + return resourceToQOS } // supportedComputeResources is the list of supported compute resources diff --git a/vendor/k8s.io/kubernetes/pkg/util/intstr/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/types.go similarity index 56% rename from vendor/k8s.io/kubernetes/pkg/util/intstr/deep_copy_generated.go rename to vendor/k8s.io/kubernetes/pkg/kubelet/qos/types.go index 29aef0223..e52dece45 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/intstr/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/qos/types.go @@ -1,7 +1,5 @@ -// +build !ignore_autogenerated - /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,17 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +package qos -package intstr +// QOSClass defines the supported qos classes of Pods/Containers. +type QOSClass string -import ( - conversion "k8s.io/kubernetes/pkg/conversion" +const ( + // Guaranteed is the Guaranteed qos class. + Guaranteed QOSClass = "Guaranteed" + // Burstable is the Burstable qos class. + Burstable QOSClass = "Burstable" + // BestEffort is the BestEffort qos class. + BestEffort QOSClass = "BestEffort" ) - -func DeepCopy_intstr_IntOrString(in IntOrString, out *IntOrString, c *conversion.Cloner) error { - out.Type = in.Type - out.IntVal = in.IntVal - out.StrVal = in.StrVal - return nil -} diff --git a/vendor/k8s.io/kubernetes/pkg/labels/doc.go b/vendor/k8s.io/kubernetes/pkg/labels/doc.go index 0e0282c35..35ba78809 100644 --- a/vendor/k8s.io/kubernetes/pkg/labels/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/labels/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/labels/labels.go b/vendor/k8s.io/kubernetes/pkg/labels/labels.go index 73324ba2b..637a45fd3 100644 --- a/vendor/k8s.io/kubernetes/pkg/labels/labels.go +++ b/vendor/k8s.io/kubernetes/pkg/labels/labels.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/labels/selector.go b/vendor/k8s.io/kubernetes/pkg/labels/selector.go index ab64ecc80..861b6eab8 100644 --- a/vendor/k8s.io/kubernetes/pkg/labels/selector.go +++ b/vendor/k8s.io/kubernetes/pkg/labels/selector.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -108,7 +108,7 @@ type Requirement struct { // (2) If the operator is In or NotIn, the values set must be non-empty. // (3) If the operator is Equals, DoubleEquals, or NotEquals, the values set must contain one value. // (4) If the operator is Exists or DoesNotExist, the value set must be empty. -// (5) If the operator is Gt or Lt, the values set must contain only one value. +// (5) If the operator is Gt or Lt, the values set must contain only one value, which will be interpreted as an integer. // (6) The key is invalid due to its length, or sequence // of characters. See validateLabelKey for more details. // @@ -135,8 +135,8 @@ func NewRequirement(key string, op Operator, vals sets.String) (*Requirement, er return nil, fmt.Errorf("for 'Gt', 'Lt' operators, exactly one value is required") } for val := range vals { - if _, err := strconv.ParseFloat(val, 64); err != nil { - return nil, fmt.Errorf("for 'Gt', 'Lt' operators, the value must be a number") + if _, err := strconv.ParseInt(val, 10, 64); err != nil { + return nil, fmt.Errorf("for 'Gt', 'Lt' operators, the value must be an integer") } } default: @@ -160,6 +160,8 @@ func NewRequirement(key string, op Operator, vals sets.String) (*Requirement, er // Labels' value for that key is not in Requirement's value set. // (4) The operator is DoesNotExist or NotIn and Labels does not have the // Requirement's key. +// (5) The operator is GreaterThanOperator or LessThanOperator, and Labels has +// the Requirement's key and the corresponding value satisfies mathematical inequality. func (r *Requirement) Matches(ls Labels) bool { switch r.operator { case InOperator, EqualsOperator, DoubleEqualsOperator: @@ -180,23 +182,23 @@ func (r *Requirement) Matches(ls Labels) bool { if !ls.Has(r.key) { return false } - lsValue, err := strconv.ParseFloat(ls.Get(r.key), 64) + lsValue, err := strconv.ParseInt(ls.Get(r.key), 10, 64) if err != nil { - glog.V(10).Infof("Parse float failed for value %+v in label %+v, %+v", ls.Get(r.key), ls, err) + glog.V(10).Infof("ParseInt failed for value %+v in label %+v, %+v", ls.Get(r.key), ls, err) return false } - // There should be only one strValue in r.strValues, and can be converted to a float number. + // There should be only one strValue in r.strValues, and can be converted to a integer. if len(r.strValues) != 1 { glog.V(10).Infof("Invalid values count %+v of requirement %+v, for 'Gt', 'Lt' operators, exactly one value is required", len(r.strValues), r) return false } - var rValue float64 + var rValue int64 for strValue := range r.strValues { - rValue, err = strconv.ParseFloat(strValue, 64) + rValue, err = strconv.ParseInt(strValue, 10, 64) if err != nil { - glog.V(10).Infof("Parse float failed for value %+v in requirement %+v, for 'Gt', 'Lt' operators, the value must be a number", strValue, r) + glog.V(10).Infof("ParseInt failed for value %+v in requirement %+v, for 'Gt', 'Lt' operators, the value must be an integer", strValue, r) return false } } @@ -467,7 +469,7 @@ func (l *Lexer) Lex() (tok Token, lit string) { } } -// Parser data structure contains the label selector parser data strucutre +// Parser data structure contains the label selector parser data structure type Parser struct { l *Lexer scannedItems []ScannedItem diff --git a/vendor/k8s.io/kubernetes/pkg/master/ports/doc.go b/vendor/k8s.io/kubernetes/pkg/master/ports/doc.go index dc6c989e8..a2a002101 100644 --- a/vendor/k8s.io/kubernetes/pkg/master/ports/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/master/ports/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/master/ports/ports.go b/vendor/k8s.io/kubernetes/pkg/master/ports/ports.go index 246a1a562..9c597ba47 100644 --- a/vendor/k8s.io/kubernetes/pkg/master/ports/ports.go +++ b/vendor/k8s.io/kubernetes/pkg/master/ports/ports.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/generic/doc.go b/vendor/k8s.io/kubernetes/pkg/registry/generic/doc.go index 2486e9b74..47bb95304 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/generic/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/generic/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/generic/matcher.go b/vendor/k8s.io/kubernetes/pkg/registry/generic/matcher.go index 08e2df7b4..a3ca2bddf 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/generic/matcher.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/generic/matcher.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/generic/options.go b/vendor/k8s.io/kubernetes/pkg/registry/generic/options.go index eea52c995..b67f3a06a 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/generic/options.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/generic/options.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/generic/storage_decorator.go b/vendor/k8s.io/kubernetes/pkg/registry/generic/storage_decorator.go index 70109efe3..79198663a 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/generic/storage_decorator.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/generic/storage_decorator.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/codec.go b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/codec.go index 9db79bdf5..c76306754 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/codec.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/codec.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -485,8 +485,6 @@ func encodeToJSON(obj *extensions.ThirdPartyResourceData, stream io.Writer) erro func (t *thirdPartyResourceDataEncoder) Encode(obj runtime.Object, stream io.Writer) (err error) { switch obj := obj.(type) { - case *versioned.InternalEvent: - return t.delegate.Encode(obj, stream) case *extensions.ThirdPartyResourceData: return encodeToJSON(obj, stream) case *extensions.ThirdPartyResourceDataList: @@ -502,6 +500,20 @@ func (t *thirdPartyResourceDataEncoder) Encode(obj runtime.Object, stream io.Wri } gv := t.gvk.GroupVersion() fmt.Fprintf(stream, template, t.gvk.Kind+"List", gv.String(), strings.Join(dataStrings, ",")) + return nil + case *versioned.InternalEvent: + event := &versioned.Event{} + err := versioned.Convert_versioned_InternalEvent_to_versioned_Event(obj, event, nil) + if err != nil { + return err + } + + enc := json.NewEncoder(stream) + err = enc.Encode(event) + if err != nil { + return err + } + return nil case *unversioned.Status, *unversioned.APIResourceList: return t.delegate.Encode(obj, stream) diff --git a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/doc.go b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/doc.go index 62e2dc1e3..d9988ccb0 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/registry.go b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/registry.go index 058276d1e..87f1156ec 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/registry.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/registry.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/strategy.go b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/strategy.go index 9f7673d7c..12108c39e 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/strategy.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/strategy.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/util.go b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/util.go index 120981e85..d8e91b157 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/util.go +++ b/vendor/k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/util.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/codec.go b/vendor/k8s.io/kubernetes/pkg/runtime/codec.go index 9cd7e1536..3f7681c00 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/codec.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/codec.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/codec_check.go b/vendor/k8s.io/kubernetes/pkg/runtime/codec_check.go index 09e7d51ad..b0126963d 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/codec_check.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/codec_check.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/conversion.go b/vendor/k8s.io/kubernetes/pkg/runtime/conversion.go index 69cf00fea..dd6e26af7 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/conversion.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/deep_copy_generated.go b/vendor/k8s.io/kubernetes/pkg/runtime/deep_copy_generated.go index fad426daa..6f5f61307 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/deep_copy_generated.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/deep_copy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,9 +49,7 @@ func DeepCopy_runtime_TypeMeta(in TypeMeta, out *TypeMeta, c *conversion.Cloner) } func DeepCopy_runtime_Unknown(in Unknown, out *Unknown, c *conversion.Cloner) error { - if err := DeepCopy_runtime_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { - return err - } + out.TypeMeta = in.TypeMeta if in.Raw != nil { in, out := in.Raw, &out.Raw *out = make([]byte, len(in)) diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/doc.go b/vendor/k8s.io/kubernetes/pkg/runtime/doc.go index 08e18891b..a9d084d9f 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -41,4 +41,5 @@ limitations under the License. // // As a bonus, a few common types useful from all api objects and versions // are provided in types.go. + package runtime diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/embedded.go b/vendor/k8s.io/kubernetes/pkg/runtime/embedded.go index a62080e39..eb1f573db 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/embedded.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/embedded.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/error.go b/vendor/k8s.io/kubernetes/pkg/runtime/error.go index ca60ee813..4041b4d96 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/error.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/error.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/extension.go b/vendor/k8s.io/kubernetes/pkg/runtime/extension.go index eca82986e..4d23ee9ee 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/extension.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/extension.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/runtime/generated.pb.go index 289268483..889dbfb15 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/generated.proto b/vendor/k8s.io/kubernetes/pkg/runtime/generated.proto index 852721228..0e602abe1 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/runtime/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -69,7 +69,7 @@ option go_package = "runtime"; // in the Object. (TODO: In the case where the object is of an unknown type, a // runtime.Unknown object will be created and stored.) // -// +gencopy=true +// +k8s:deepcopy-gen=true // +protobuf=true message RawExtension { // Raw is the underlying serialization of this object. @@ -89,7 +89,7 @@ message RawExtension { // TypeMeta is provided here for convenience. You may use it directly from this package or define // your own with the same fields. // -// +gencopy=true +// +k8s:deepcopy-gen=true // +protobuf=true message TypeMeta { optional string apiVersion = 1; @@ -103,7 +103,7 @@ message TypeMeta { // TODO: Make this object have easy access to field based accessors and settors for // metadata and field mutatation. // -// +gencopy=true +// +k8s:deepcopy-gen=true // +protobuf=true message Unknown { optional TypeMeta typeMeta = 1; diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/helper.go b/vendor/k8s.io/kubernetes/pkg/runtime/helper.go index b131fdcd9..827cff1b8 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/helper.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/helper.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/interfaces.go b/vendor/k8s.io/kubernetes/pkg/runtime/interfaces.go index 7239ac44c..e46324608 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/interfaces.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/register.go b/vendor/k8s.io/kubernetes/pkg/runtime/register.go index 5201a15ff..39a1eb14b 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/register.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/scheme.go b/vendor/k8s.io/kubernetes/pkg/runtime/scheme.go index c49c43e93..f98ec54ab 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/scheme.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/scheme.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/codec_factory.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/codec_factory.go index 4432e4896..758aa6b74 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/codec_factory.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/codec_factory.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/json.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/json.go index c226448f3..c26fa50d8 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/json.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/json.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/meta.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/meta.go index 91df105ed..b9bea21eb 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/meta.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/meta.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/negotiated_codec.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/negotiated_codec.go index 6f6a56dd3..59b078ce8 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/negotiated_codec.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/negotiated_codec.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/doc.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/doc.go index 91b86af6c..381748d69 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/protobuf.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/protobuf.go index a202a18d6..b9eb9e5db 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/protobuf.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf/protobuf.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf_extension.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf_extension.go index a93708c45..5846d94d5 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf_extension.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/protobuf_extension.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/recognizer/recognizer.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/recognizer/recognizer.go index 4b8b1e204..310002a24 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/recognizer/recognizer.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/recognizer/recognizer.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/streaming/streaming.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/streaming/streaming.go index c34f9a570..ac17138e4 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/streaming/streaming.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/streaming/streaming.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/versioning/versioning.go b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/versioning/versioning.go index f69d126c8..6e67964b1 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/serializer/versioning/versioning.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/serializer/versioning/versioning.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/swagger_doc_generator.go b/vendor/k8s.io/kubernetes/pkg/runtime/swagger_doc_generator.go index 19b8378a4..29722d52e 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/swagger_doc_generator.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/swagger_doc_generator.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/types.go b/vendor/k8s.io/kubernetes/pkg/runtime/types.go index e646d2afa..5033c0dc2 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/types.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/types.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -40,7 +40,7 @@ import ( // TypeMeta is provided here for convenience. You may use it directly from this package or define // your own with the same fields. // -// +gencopy=true +// +k8s:deepcopy-gen=true // +protobuf=true type TypeMeta struct { APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"` @@ -93,7 +93,7 @@ const ( // in the Object. (TODO: In the case where the object is of an unknown type, a // runtime.Unknown object will be created and stored.) // -// +gencopy=true +// +k8s:deepcopy-gen=true // +protobuf=true type RawExtension struct { // Raw is the underlying serialization of this object. @@ -111,7 +111,7 @@ type RawExtension struct { // TODO: Make this object have easy access to field based accessors and settors for // metadata and field mutatation. // -// +gencopy=true +// +k8s:deepcopy-gen=true // +protobuf=true type Unknown struct { TypeMeta `json:",inline" protobuf:"bytes,1,opt,name=typeMeta"` diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/types_proto.go b/vendor/k8s.io/kubernetes/pkg/runtime/types_proto.go index 142dd05da..ead96ee05 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/types_proto.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/types_proto.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/runtime/unstructured.go b/vendor/k8s.io/kubernetes/pkg/runtime/unstructured.go index 4a15142c1..048e6dc14 100644 --- a/vendor/k8s.io/kubernetes/pkg/runtime/unstructured.go +++ b/vendor/k8s.io/kubernetes/pkg/runtime/unstructured.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/security/podsecuritypolicy/util/util.go b/vendor/k8s.io/kubernetes/pkg/security/podsecuritypolicy/util/util.go index 097b1a6c2..0af4ad060 100644 --- a/vendor/k8s.io/kubernetes/pkg/security/podsecuritypolicy/util/util.go +++ b/vendor/k8s.io/kubernetes/pkg/security/podsecuritypolicy/util/util.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/storage/cacher.go b/vendor/k8s.io/kubernetes/pkg/storage/cacher.go index e7b4d63e2..e258e5f13 100644 --- a/vendor/k8s.io/kubernetes/pkg/storage/cacher.go +++ b/vendor/k8s.io/kubernetes/pkg/storage/cacher.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -28,7 +28,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/rest" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/conversion" @@ -73,19 +72,13 @@ type CacherConfig struct { type Cacher struct { sync.RWMutex - // Each user-facing method that is not simply redirected to the underlying - // storage has to read-lock on this mutex before starting any processing. + // Before accessing the cacher's cache, wait for the ready to be ok. // This is necessary to prevent users from accessing structures that are // uninitialized or are being repopulated right now. - // NOTE: We cannot easily reuse the main mutex for it due to multi-threaded - // interactions of Cacher with the underlying WatchCache. Since Cacher is - // caling WatchCache directly and WatchCache is calling Cacher methods - // via its OnEvent and OnReplace hooks, we explicitly assume that if mutexes - // of both structures are held, the one from WatchCache is acquired first - // to avoid deadlocks. Unfortunately, forcing this rule in startCaching - // would be very difficult and introducing one more mutex seems to be much - // easier. - usable sync.RWMutex + // ready needs to be set to false when the cacher is paused or stopped. + // ready needs to be set to true when the cacher is ready to use after + // initialization. + ready *ready // Underlying storage.Interface. storage Interface @@ -111,37 +104,6 @@ type Cacher struct { stopWg sync.WaitGroup } -// Create a new Cacher responsible from service WATCH and LIST requests from its -// internal cache and updating its cache in the background based on the given -// configuration. -func NewCacher( - storage Interface, - capacity int, - versioner Versioner, - objectType runtime.Object, - resourcePrefix string, - scopeStrategy rest.NamespaceScopedStrategy, - newListFunc func() runtime.Object) Interface { - config := CacherConfig{ - CacheCapacity: capacity, - Storage: storage, - Versioner: versioner, - Type: objectType, - ResourcePrefix: resourcePrefix, - NewListFunc: newListFunc, - } - if scopeStrategy.NamespaceScoped() { - config.KeyFunc = func(obj runtime.Object) (string, error) { - return NamespaceKeyFunc(resourcePrefix, obj) - } - } else { - config.KeyFunc = func(obj runtime.Object) (string, error) { - return NoNamespaceKeyFunc(resourcePrefix, obj) - } - } - return NewCacherFromConfig(config) -} - // Create a new Cacher responsible from service WATCH and LIST requests from its // internal cache and updating its cache in the background based on the given // configuration. @@ -158,25 +120,20 @@ func NewCacherFromConfig(config CacherConfig) *Cacher { } cacher := &Cacher{ - usable: sync.RWMutex{}, + ready: newReady(), storage: config.Storage, watchCache: watchCache, reflector: cache.NewReflector(listerWatcher, config.Type, watchCache, 0), - watcherIdx: 0, watchers: make(map[int]*cacheWatcher), versioner: config.Versioner, keyFunc: config.KeyFunc, - stopped: false, // We need to (potentially) stop both: // - wait.Until go-routine // - reflector.ListAndWatch // and there are no guarantees on the order that they will stop. // So we will be simply closing the channel, and synchronizing on the WaitGroup. stopCh: make(chan struct{}), - stopWg: sync.WaitGroup{}, } - // See startCaching method for explanation and where this is unlocked. - cacher.usable.Lock() watchCache.SetOnEvent(cacher.processEvent) stopCh := cacher.stopCh @@ -204,11 +161,11 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) { successfulList := false c.watchCache.SetOnReplace(func() { successfulList = true - c.usable.Unlock() + c.ready.set(true) }) defer func() { if successfulList { - c.usable.Lock() + c.ready.set(false) } }() @@ -249,9 +206,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, resourceVersion string, return nil, err } - // Do NOT allow Watch to start when the underlying structures are not propagated. - c.usable.RLock() - defer c.usable.RUnlock() + c.ready.wait() // We explicitly use thread unsafe version and do locking ourself to ensure that // no new events will be processed in the meantime. The watchCache will be unlocked @@ -308,13 +263,7 @@ func (c *Cacher) List(ctx context.Context, key string, resourceVersion string, f return err } - // To avoid situation when List is processed before the underlying - // watchCache is propagated for the first time, we acquire and immediately - // release the 'usable' lock. - // We don't need to hold it all the time, because watchCache is thread-safe - // and it would complicate already very difficult locking pattern. - c.usable.RLock() - c.usable.RUnlock() + c.ready.wait() // List elements from cache, with at least 'listRV'. listPtr, err := meta.GetItemsPtr(listObj) @@ -417,18 +366,13 @@ func filterFunction(key string, keyFunc func(runtime.Object) (string, error), fi // Returns resource version to which the underlying cache is synced. func (c *Cacher) LastSyncResourceVersion() (uint64, error) { - // To avoid situation when LastSyncResourceVersion is processed before the - // underlying watchCache is propagated, we acquire 'usable' lock. - c.usable.RLock() - defer c.usable.RUnlock() - - c.RLock() - defer c.RUnlock() + c.ready.wait() resourceVersion := c.reflector.LastSyncResourceVersion() if resourceVersion == "" { return 0, nil } + return strconv.ParseUint(resourceVersion, 10, 64) } @@ -627,3 +571,27 @@ func (c *cacheWatcher) process(initEvents []watchCacheEvent, resourceVersion uin } } } + +type ready struct { + ok bool + c *sync.Cond +} + +func newReady() *ready { + return &ready{c: sync.NewCond(&sync.Mutex{})} +} + +func (r *ready) wait() { + r.c.L.Lock() + for !r.ok { + r.c.Wait() + } + r.c.L.Unlock() +} + +func (r *ready) set(ok bool) { + r.c.L.Lock() + defer r.c.L.Unlock() + r.ok = ok + r.c.Broadcast() +} diff --git a/vendor/k8s.io/kubernetes/pkg/storage/doc.go b/vendor/k8s.io/kubernetes/pkg/storage/doc.go index dca0d5b70..d2c5dbfc4 100644 --- a/vendor/k8s.io/kubernetes/pkg/storage/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/storage/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/storage/errors.go b/vendor/k8s.io/kubernetes/pkg/storage/errors.go index 61b3cba52..26985fa07 100644 --- a/vendor/k8s.io/kubernetes/pkg/storage/errors.go +++ b/vendor/k8s.io/kubernetes/pkg/storage/errors.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/storage/interfaces.go b/vendor/k8s.io/kubernetes/pkg/storage/interfaces.go index 89290e29a..8673a101f 100644 --- a/vendor/k8s.io/kubernetes/pkg/storage/interfaces.go +++ b/vendor/k8s.io/kubernetes/pkg/storage/interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/storage/util.go b/vendor/k8s.io/kubernetes/pkg/storage/util.go index 6595a6763..86ebc0e42 100644 --- a/vendor/k8s.io/kubernetes/pkg/storage/util.go +++ b/vendor/k8s.io/kubernetes/pkg/storage/util.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go b/vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go index 3e5ce5d73..1fd43fc00 100644 --- a/vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go +++ b/vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/types/doc.go b/vendor/k8s.io/kubernetes/pkg/types/doc.go index 239a9a5f5..783cbcdc8 100644 --- a/vendor/k8s.io/kubernetes/pkg/types/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/types/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/types/namespacedname.go b/vendor/k8s.io/kubernetes/pkg/types/namespacedname.go index 895d7c5be..70a9ac3e2 100644 --- a/vendor/k8s.io/kubernetes/pkg/types/namespacedname.go +++ b/vendor/k8s.io/kubernetes/pkg/types/namespacedname.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/types/uid.go b/vendor/k8s.io/kubernetes/pkg/types/uid.go index de6cd18fb..869339222 100644 --- a/vendor/k8s.io/kubernetes/pkg/types/uid.go +++ b/vendor/k8s.io/kubernetes/pkg/types/uid.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/types/unix_user_id.go b/vendor/k8s.io/kubernetes/pkg/types/unix_user_id.go index b59792abf..dc770c11e 100644 --- a/vendor/k8s.io/kubernetes/pkg/types/unix_user_id.go +++ b/vendor/k8s.io/kubernetes/pkg/types/unix_user_id.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/clock.go b/vendor/k8s.io/kubernetes/pkg/util/clock.go index 474cbb68d..71aca9eda 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/clock.go +++ b/vendor/k8s.io/kubernetes/pkg/util/clock.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/crypto/crypto.go b/vendor/k8s.io/kubernetes/pkg/util/crypto/crypto.go index f43664369..b573c8a59 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/crypto/crypto.go +++ b/vendor/k8s.io/kubernetes/pkg/util/crypto/crypto.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/doc.go b/vendor/k8s.io/kubernetes/pkg/util/doc.go index cd3f0823e..1747db550 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/errors/doc.go b/vendor/k8s.io/kubernetes/pkg/util/errors/doc.go index b0af0f055..b3b39bc38 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/errors/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/errors/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/errors/errors.go b/vendor/k8s.io/kubernetes/pkg/util/errors/errors.go index df3adaf3e..0445c142b 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/errors/errors.go +++ b/vendor/k8s.io/kubernetes/pkg/util/errors/errors.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/flag/flags.go b/vendor/k8s.io/kubernetes/pkg/util/flag/flags.go index 94b9f733f..24e961f27 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/flag/flags.go +++ b/vendor/k8s.io/kubernetes/pkg/util/flag/flags.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/flag/tristate.go b/vendor/k8s.io/kubernetes/pkg/util/flag/tristate.go index a9359695f..cf16376bf 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/flag/tristate.go +++ b/vendor/k8s.io/kubernetes/pkg/util/flag/tristate.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/backoff.go b/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/backoff.go index 1898c55c9..59b9976f1 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/backoff.go +++ b/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/backoff.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/throttle.go b/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/throttle.go index a63817ca8..482ba7d14 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/throttle.go +++ b/vendor/k8s.io/kubernetes/pkg/util/flowcontrol/throttle.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/framer/framer.go b/vendor/k8s.io/kubernetes/pkg/util/framer/framer.go index 7ca806fa0..066680f44 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/framer/framer.go +++ b/vendor/k8s.io/kubernetes/pkg/util/framer/framer.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/hash/hash.go b/vendor/k8s.io/kubernetes/pkg/util/hash/hash.go index 95fd32abe..803f066a4 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/hash/hash.go +++ b/vendor/k8s.io/kubernetes/pkg/util/hash/hash.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/homedir/homedir.go b/vendor/k8s.io/kubernetes/pkg/util/homedir/homedir.go index 57171e109..403475491 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/homedir/homedir.go +++ b/vendor/k8s.io/kubernetes/pkg/util/homedir/homedir.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/integer/integer.go b/vendor/k8s.io/kubernetes/pkg/util/integer/integer.go index c51cd952d..c6ea106f9 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/integer/integer.go +++ b/vendor/k8s.io/kubernetes/pkg/util/integer/integer.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,6 +30,20 @@ func IntMin(a, b int) int { return a } +func Int32Max(a, b int32) int32 { + if b > a { + return b + } + return a +} + +func Int32Min(a, b int32) int32 { + if b < a { + return b + } + return a +} + func Int64Max(a, b int64) int64 { if b > a { return b @@ -43,3 +57,11 @@ func Int64Min(a, b int64) int64 { } return a } + +// RoundToInt32 rounds floats into integer numbers. +func RoundToInt32(a float64) int32 { + if a < 0 { + return int32(a - 0.5) + } + return int32(a + 0.5) +} diff --git a/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.pb.go index ef39cd586..3c2bf4fb1 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.proto b/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.proto index 32ad1b6b1..dd508e1c8 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/util/intstr/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ option go_package = "intstr"; // accept a name or number. // TODO: Rename to Int32OrString // -// +gencopy=true // +protobuf=true // +protobuf.options.(gogoproto.goproto_stringer)=false message IntOrString { diff --git a/vendor/k8s.io/kubernetes/pkg/util/intstr/intstr.go b/vendor/k8s.io/kubernetes/pkg/util/intstr/intstr.go index 53bc0fc7e..59e7a0663 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/intstr/intstr.go +++ b/vendor/k8s.io/kubernetes/pkg/util/intstr/intstr.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -32,7 +32,6 @@ import ( // accept a name or number. // TODO: Rename to Int32OrString // -// +gencopy=true // +protobuf=true // +protobuf.options.(gogoproto.goproto_stringer)=false type IntOrString struct { @@ -144,5 +143,5 @@ func getIntOrPercentValue(intOrStr *IntOrString) (int, bool, error) { } return int(v), true, nil } - return 0, false, fmt.Errorf("invalid value: neither int nor percentage") + return 0, false, fmt.Errorf("invalid type: neither int nor percentage") } diff --git a/vendor/k8s.io/kubernetes/pkg/util/json/json.go b/vendor/k8s.io/kubernetes/pkg/util/json/json.go index 1ff8cc0d4..e8054a12e 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/json/json.go +++ b/vendor/k8s.io/kubernetes/pkg/util/json/json.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/doc.go b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/doc.go index 6bdf4ac59..2a6e17061 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/jsonpath.go b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/jsonpath.go index 7a402af49..0b48b2ed5 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/jsonpath.go +++ b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/jsonpath.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -23,7 +23,7 @@ import ( "reflect" "strings" - "k8s.io/kubernetes/third_party/golang/template" + "k8s.io/kubernetes/third_party/forked/golang/template" ) type JSONPath struct { diff --git a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/node.go b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/node.go index ddf015c04..f0a27853d 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/node.go +++ b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/node.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/parser.go b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/parser.go index bd1f5ecd4..1ff82a3b9 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/jsonpath/parser.go +++ b/vendor/k8s.io/kubernetes/pkg/util/jsonpath/parser.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/labels/doc.go b/vendor/k8s.io/kubernetes/pkg/util/labels/doc.go index 0746d878d..c87305fb0 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/labels/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/labels/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/labels/labels.go b/vendor/k8s.io/kubernetes/pkg/util/labels/labels.go index 624d5ad68..262f66e6e 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/labels/labels.go +++ b/vendor/k8s.io/kubernetes/pkg/util/labels/labels.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/line_delimiter.go b/vendor/k8s.io/kubernetes/pkg/util/line_delimiter.go index b48478df8..9f64260c8 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/line_delimiter.go +++ b/vendor/k8s.io/kubernetes/pkg/util/line_delimiter.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/logs.go b/vendor/k8s.io/kubernetes/pkg/util/logs.go index c79c4903d..ea27f484f 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/logs.go +++ b/vendor/k8s.io/kubernetes/pkg/util/logs.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/net/http.go b/vendor/k8s.io/kubernetes/pkg/util/net/http.go index 68073776a..582fb9a58 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/net/http.go +++ b/vendor/k8s.io/kubernetes/pkg/util/net/http.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -77,8 +77,10 @@ func SetOldTransportDefaults(t *http.Transport) *http.Transport { // for the Proxy, Dial, and TLSHandshakeTimeout fields if unset func SetTransportDefaults(t *http.Transport) *http.Transport { t = SetOldTransportDefaults(t) - // Allow HTTP2 clients but default off for now - if s := os.Getenv("ENABLE_HTTP2"); len(s) > 0 { + // Allow clients to disable http2 if needed. + if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 { + glog.Infof("HTTP2 has been explicitly disabled") + } else { if err := http2.ConfigureTransport(t); err != nil { glog.Warningf("Transport failed http2 configuration: %v", err) } diff --git a/vendor/k8s.io/kubernetes/pkg/util/net/interface.go b/vendor/k8s.io/kubernetes/pkg/util/net/interface.go index cdf5ddb54..a1e53d2e4 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/net/interface.go +++ b/vendor/k8s.io/kubernetes/pkg/util/net/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/net/port_range.go b/vendor/k8s.io/kubernetes/pkg/util/net/port_range.go index 527552571..6afdbf25f 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/net/port_range.go +++ b/vendor/k8s.io/kubernetes/pkg/util/net/port_range.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/net/port_split.go b/vendor/k8s.io/kubernetes/pkg/util/net/port_split.go index be40eb75f..29c985edc 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/net/port_split.go +++ b/vendor/k8s.io/kubernetes/pkg/util/net/port_split.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go b/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go index db117f63e..5b6fe933f 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go +++ b/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/net/util.go b/vendor/k8s.io/kubernetes/pkg/util/net/util.go new file mode 100644 index 000000000..1348f4dee --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/util/net/util.go @@ -0,0 +1,36 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package net + +import ( + "net" + "reflect" +) + +// IPNetEqual checks if the two input IPNets are representing the same subnet. +// For example, +// 10.0.0.1/24 and 10.0.0.0/24 are the same subnet. +// 10.0.0.1/24 and 10.0.0.0/25 are not the same subnet. +func IPNetEqual(ipnet1, ipnet2 *net.IPNet) bool { + if ipnet1 == nil || ipnet2 == nil { + return false + } + if reflect.DeepEqual(ipnet1.Mask, ipnet2.Mask) && ipnet1.Contains(ipnet2.IP) && ipnet2.Contains(ipnet1.IP) { + return true + } + return false +} diff --git a/vendor/k8s.io/kubernetes/pkg/util/parsers/parsers.go b/vendor/k8s.io/kubernetes/pkg/util/parsers/parsers.go index a02f18d3e..4e70cc682 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/parsers/parsers.go +++ b/vendor/k8s.io/kubernetes/pkg/util/parsers/parsers.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/pod/doc.go b/vendor/k8s.io/kubernetes/pkg/util/pod/doc.go index 3bad7d0b7..d7a8ff226 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/pod/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/pod/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/pod/pod.go b/vendor/k8s.io/kubernetes/pkg/util/pod/pod.go index 9c57aaebb..e2286c7a0 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/pod/pod.go +++ b/vendor/k8s.io/kubernetes/pkg/util/pod/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/rand/rand.go b/vendor/k8s.io/kubernetes/pkg/util/rand/rand.go index 1f646fbd9..134c15260 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/rand/rand.go +++ b/vendor/k8s.io/kubernetes/pkg/util/rand/rand.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -81,19 +81,3 @@ func String(length int) string { } return string(b) } - -// A type that satisfies the rand.Shufflable interface can be shuffled -// by Shuffle. Any sort.Interface will satisfy this interface. -type Shufflable interface { - Len() int - Swap(i, j int) -} - -func Shuffle(data Shufflable) { - rng.Lock() - defer rng.Unlock() - for i := 0; i < data.Len(); i++ { - j := rng.rand.Intn(i + 1) - data.Swap(i, j) - } -} diff --git a/vendor/k8s.io/kubernetes/pkg/util/replicaset/replicaset.go b/vendor/k8s.io/kubernetes/pkg/util/replicaset/replicaset.go index e5dd26517..206bba2dc 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/replicaset/replicaset.go +++ b/vendor/k8s.io/kubernetes/pkg/util/replicaset/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/resource_container_linux.go b/vendor/k8s.io/kubernetes/pkg/util/resource_container_linux.go index 8d166045e..a844e4c14 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/resource_container_linux.go +++ b/vendor/k8s.io/kubernetes/pkg/util/resource_container_linux.go @@ -1,7 +1,7 @@ // +build linux /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/resource_container_unsupported.go b/vendor/k8s.io/kubernetes/pkg/util/resource_container_unsupported.go index a8ee51927..ba861b0df 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/resource_container_unsupported.go +++ b/vendor/k8s.io/kubernetes/pkg/util/resource_container_unsupported.go @@ -1,7 +1,7 @@ // +build !linux /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/runner.go b/vendor/k8s.io/kubernetes/pkg/util/runner.go index 60645cf0e..9e977ee1e 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/runner.go +++ b/vendor/k8s.io/kubernetes/pkg/util/runner.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/runtime/runtime.go b/vendor/k8s.io/kubernetes/pkg/util/runtime/runtime.go index f404d25d1..464d3ee12 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/runtime/runtime.go +++ b/vendor/k8s.io/kubernetes/pkg/util/runtime/runtime.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/sets/byte.go b/vendor/k8s.io/kubernetes/pkg/util/sets/byte.go index fe1068cdf..45f5d4f67 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/sets/byte.go +++ b/vendor/k8s.io/kubernetes/pkg/util/sets/byte.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/sets/doc.go b/vendor/k8s.io/kubernetes/pkg/util/sets/doc.go index a27cb62f5..c5e541621 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/sets/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/sets/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/sets/empty.go b/vendor/k8s.io/kubernetes/pkg/util/sets/empty.go index 73ac74c14..5654edd77 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/sets/empty.go +++ b/vendor/k8s.io/kubernetes/pkg/util/sets/empty.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/sets/int.go b/vendor/k8s.io/kubernetes/pkg/util/sets/int.go index e7a2b5db1..4b8c331b5 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/sets/int.go +++ b/vendor/k8s.io/kubernetes/pkg/util/sets/int.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/sets/int64.go b/vendor/k8s.io/kubernetes/pkg/util/sets/int64.go index f31da7750..b6a97e70d 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/sets/int64.go +++ b/vendor/k8s.io/kubernetes/pkg/util/sets/int64.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/sets/string.go b/vendor/k8s.io/kubernetes/pkg/util/sets/string.go index 572aa9157..2094b3205 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/sets/string.go +++ b/vendor/k8s.io/kubernetes/pkg/util/sets/string.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/slice/slice.go b/vendor/k8s.io/kubernetes/pkg/util/slice/slice.go index f32dbabcf..2e1d7ccb5 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/slice/slice.go +++ b/vendor/k8s.io/kubernetes/pkg/util/slice/slice.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/strategicpatch/patch.go b/vendor/k8s.io/kubernetes/pkg/util/strategicpatch/patch.go index 676713bc8..18d80f9b8 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/strategicpatch/patch.go +++ b/vendor/k8s.io/kubernetes/pkg/util/strategicpatch/patch.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -22,7 +22,7 @@ import ( "sort" "k8s.io/kubernetes/pkg/util/json" - forkedjson "k8s.io/kubernetes/third_party/forked/json" + forkedjson "k8s.io/kubernetes/third_party/forked/golang/json" "github.com/davecgh/go-spew/spew" "github.com/ghodss/yaml" diff --git a/vendor/k8s.io/kubernetes/pkg/util/string_flag.go b/vendor/k8s.io/kubernetes/pkg/util/string_flag.go index 4208bf5f6..9d6a00a15 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/string_flag.go +++ b/vendor/k8s.io/kubernetes/pkg/util/string_flag.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/sysctl/sysctl.go b/vendor/k8s.io/kubernetes/pkg/util/sysctl/sysctl.go new file mode 100644 index 000000000..bbf52736c --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/util/sysctl/sysctl.go @@ -0,0 +1,56 @@ +/* +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 sysctl + +import ( + "io/ioutil" + "path" + "strconv" + "strings" +) + +const ( + sysctlBase = "/proc/sys" + VmOvercommitMemory = "vm/overcommit_memory" + VmPanicOnOOM = "vm/panic_on_oom" + KernelPanic = "kernel/panic" + KernelPanicOnOops = "kernel/panic_on_oops" + + VmOvercommitMemoryAlways = 1 // kernel performs no memory over-commit handling + VmPanicOnOOMInvokeOOMKiller = 0 // kernel calls the oom_killer function when OOM occurs + + KernelPanicOnOopsAlways = 1 // kernel panics on kernel oops + KernelPanicRebootTimeout = 10 // seconds after a panic for the kernel to reboot +) + +// GetSysctl returns the value for the specified sysctl setting +func GetSysctl(sysctl string) (int, error) { + data, err := ioutil.ReadFile(path.Join(sysctlBase, sysctl)) + if err != nil { + return -1, err + } + val, err := strconv.Atoi(strings.Trim(string(data), " \n")) + if err != nil { + return -1, err + } + return val, nil +} + +// SetSysctl modifies the specified sysctl flag to the new value +func SetSysctl(sysctl string, newVal int) error { + return ioutil.WriteFile(path.Join(sysctlBase, sysctl), []byte(strconv.Itoa(newVal)), 0640) +} diff --git a/vendor/k8s.io/kubernetes/pkg/util/template.go b/vendor/k8s.io/kubernetes/pkg/util/template.go index 1f9668533..d09d7dc86 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/template.go +++ b/vendor/k8s.io/kubernetes/pkg/util/template.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/trace.go b/vendor/k8s.io/kubernetes/pkg/util/trace.go index ed9da94b3..fe93db8df 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/trace.go +++ b/vendor/k8s.io/kubernetes/pkg/util/trace.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/umask.go b/vendor/k8s.io/kubernetes/pkg/util/umask.go index 48311f4e3..35ccce50b 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/umask.go +++ b/vendor/k8s.io/kubernetes/pkg/util/umask.go @@ -1,7 +1,7 @@ // +build !windows /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/umask_windows.go b/vendor/k8s.io/kubernetes/pkg/util/umask_windows.go index 0f97c26ed..8c1b2cbc7 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/umask_windows.go +++ b/vendor/k8s.io/kubernetes/pkg/util/umask_windows.go @@ -1,7 +1,7 @@ // +build windows /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/util.go b/vendor/k8s.io/kubernetes/pkg/util/util.go index 4826a448b..7a9414957 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/util.go +++ b/vendor/k8s.io/kubernetes/pkg/util/util.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/uuid.go b/vendor/k8s.io/kubernetes/pkg/util/uuid.go index 7e1396f12..23abe1156 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/uuid.go +++ b/vendor/k8s.io/kubernetes/pkg/util/uuid.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/validation/field/errors.go b/vendor/k8s.io/kubernetes/pkg/util/validation/field/errors.go index 203f7cc8f..b4a6c5cd5 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/validation/field/errors.go +++ b/vendor/k8s.io/kubernetes/pkg/util/validation/field/errors.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/validation/field/path.go b/vendor/k8s.io/kubernetes/pkg/util/validation/field/path.go index 30ff5a8f7..2efc8eec7 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/validation/field/path.go +++ b/vendor/k8s.io/kubernetes/pkg/util/validation/field/path.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/validation/validation.go b/vendor/k8s.io/kubernetes/pkg/util/validation/validation.go index 9361a4bfa..6e6a0270c 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/validation/validation.go +++ b/vendor/k8s.io/kubernetes/pkg/util/validation/validation.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. @@ -85,10 +85,10 @@ func IsValidLabelValue(value string) []string { return errs } -const DNS1123LabelFmt string = "[a-z0-9]([-a-z0-9]*[a-z0-9])?" +const dns1123LabelFmt string = "[a-z0-9]([-a-z0-9]*[a-z0-9])?" const DNS1123LabelMaxLength int = 63 -var dns1123LabelRegexp = regexp.MustCompile("^" + DNS1123LabelFmt + "$") +var dns1123LabelRegexp = regexp.MustCompile("^" + dns1123LabelFmt + "$") // IsDNS1123Label tests for a string that conforms to the definition of a label in // DNS (RFC 1123). @@ -98,15 +98,15 @@ func IsDNS1123Label(value string) []string { errs = append(errs, MaxLenError(DNS1123LabelMaxLength)) } if !dns1123LabelRegexp.MatchString(value) { - errs = append(errs, RegexError(DNS1123LabelFmt, "my-name", "123-abc")) + errs = append(errs, RegexError(dns1123LabelFmt, "my-name", "123-abc")) } return errs } -const DNS1123SubdomainFmt string = DNS1123LabelFmt + "(\\." + DNS1123LabelFmt + ")*" +const dns1123SubdomainFmt string = dns1123LabelFmt + "(\\." + dns1123LabelFmt + ")*" const DNS1123SubdomainMaxLength int = 253 -var dns1123SubdomainRegexp = regexp.MustCompile("^" + DNS1123SubdomainFmt + "$") +var dns1123SubdomainRegexp = regexp.MustCompile("^" + dns1123SubdomainFmt + "$") // IsDNS1123Subdomain tests for a string that conforms to the definition of a // subdomain in DNS (RFC 1123). @@ -116,15 +116,15 @@ func IsDNS1123Subdomain(value string) []string { errs = append(errs, MaxLenError(DNS1123SubdomainMaxLength)) } if !dns1123SubdomainRegexp.MatchString(value) { - errs = append(errs, RegexError(DNS1123SubdomainFmt, "example.com")) + errs = append(errs, RegexError(dns1123SubdomainFmt, "example.com")) } return errs } -const DNS952LabelFmt string = "[a-z]([-a-z0-9]*[a-z0-9])?" +const dns952LabelFmt string = "[a-z]([-a-z0-9]*[a-z0-9])?" const DNS952LabelMaxLength int = 24 -var dns952LabelRegexp = regexp.MustCompile("^" + DNS952LabelFmt + "$") +var dns952LabelRegexp = regexp.MustCompile("^" + dns952LabelFmt + "$") // IsDNS952Label tests for a string that conforms to the definition of a label in // DNS (RFC 952). @@ -134,24 +134,30 @@ func IsDNS952Label(value string) []string { errs = append(errs, MaxLenError(DNS952LabelMaxLength)) } if !dns952LabelRegexp.MatchString(value) { - errs = append(errs, RegexError(DNS952LabelFmt, "my-name", "abc-123")) + errs = append(errs, RegexError(dns952LabelFmt, "my-name", "abc-123")) } return errs } -const CIdentifierFmt string = "[A-Za-z_][A-Za-z0-9_]*" +const cIdentifierFmt string = "[A-Za-z_][A-Za-z0-9_]*" -var cIdentifierRegexp = regexp.MustCompile("^" + CIdentifierFmt + "$") +var cIdentifierRegexp = regexp.MustCompile("^" + cIdentifierFmt + "$") // IsCIdentifier tests for a string that conforms the definition of an identifier // in C. This checks the format, but not the length. -func IsCIdentifier(value string) bool { - return cIdentifierRegexp.MatchString(value) +func IsCIdentifier(value string) []string { + if !cIdentifierRegexp.MatchString(value) { + return []string{RegexError(cIdentifierFmt, "my_name", "MY_NAME", "MyName")} + } + return nil } // IsValidPortNum tests that the argument is a valid, non-zero port number. -func IsValidPortNum(port int) bool { - return 0 < port && port < 65536 +func IsValidPortNum(port int) []string { + if 1 <= port && port <= 65535 { + return nil + } + return []string{InclusiveRangeError(1, 65535)} } // Now in libcontainer UID/GID limits is 0 ~ 1<<31 - 1 @@ -163,67 +169,99 @@ const ( maxGroupID = math.MaxInt32 ) -// IsValidGroupId tests that the argument is a valid gids. -func IsValidGroupId(gid int64) bool { - return minGroupID <= gid && gid <= maxGroupID +// IsValidGroupId tests that the argument is a valid Unix GID. +func IsValidGroupId(gid int64) []string { + if minGroupID <= gid && gid <= maxGroupID { + return nil + } + return []string{InclusiveRangeError(minGroupID, maxGroupID)} } -// IsValidUserId tests that the argument is a valid uids. -func IsValidUserId(uid int64) bool { - return minUserID <= uid && uid <= maxUserID +// IsValidUserId tests that the argument is a valid Unix UID. +func IsValidUserId(uid int64) []string { + if minUserID <= uid && uid <= maxUserID { + return nil + } + return []string{InclusiveRangeError(minUserID, maxUserID)} } -const doubleHyphensFmt string = ".*(--).*" +var portNameCharsetRegex = regexp.MustCompile("^[-a-z0-9]+$") +var portNameOneLetterRegexp = regexp.MustCompile("[a-z]") -var doubleHyphensRegexp = regexp.MustCompile("^" + doubleHyphensFmt + "$") - -const IdentifierNoHyphensBeginEndFmt string = "[a-z0-9]([a-z0-9-]*[a-z0-9])*" - -var identifierNoHyphensBeginEndRegexp = regexp.MustCompile("^" + IdentifierNoHyphensBeginEndFmt + "$") - -const atLeastOneLetterFmt string = ".*[a-z].*" - -var atLeastOneLetterRegexp = regexp.MustCompile("^" + atLeastOneLetterFmt + "$") - -// IsValidPortName check that the argument is valid syntax. It must be non empty and no more than 15 characters long -// It must contains at least one letter [a-z] and it must contains only [a-z0-9-]. -// Hypens ('-') cannot be leading or trailing character of the string and cannot be adjacent to other hyphens. -// Although RFC 6335 allows upper and lower case characters but case is ignored for comparison purposes: (HTTP -// and http denote the same service). -func IsValidPortName(port string) bool { - if len(port) < 1 || len(port) > 15 { - return false +// IsValidPortName check that the argument is valid syntax. It must be +// non-empty and no more than 15 characters long. It may contain only [-a-z0-9] +// and must contain at least one letter [a-z]. It must not start or end with a +// hyphen, nor contain adjacent hyphens. +// +// Note: We only allow lower-case characters, even though RFC 6335 is case +// insensitive. +func IsValidPortName(port string) []string { + var errs []string + if len(port) > 15 { + errs = append(errs, MaxLenError(15)) } - if doubleHyphensRegexp.MatchString(port) { - return false + if !portNameCharsetRegex.MatchString(port) { + errs = append(errs, "must contain only alpha-numeric characters (a-z, 0-9), and hyphens (-)") } - if identifierNoHyphensBeginEndRegexp.MatchString(port) && atLeastOneLetterRegexp.MatchString(port) { - return true + if !portNameOneLetterRegexp.MatchString(port) { + errs = append(errs, "must contain at least one letter (a-z)") } - return false + if strings.Contains(port, "--") { + errs = append(errs, "must not contain consecutive hyphens") + } + if len(port) > 0 && (port[0] == '-' || port[len(port)-1] == '-') { + errs = append(errs, "must not begin or end with a hyphen") + } + return errs } // IsValidIP tests that the argument is a valid IP address. -func IsValidIP(value string) bool { - return net.ParseIP(value) != nil +func IsValidIP(value string) []string { + if net.ParseIP(value) == nil { + return []string{"must be a valid IP address, (e.g. 10.9.8.7)"} + } + return nil } const percentFmt string = "[0-9]+%" var percentRegexp = regexp.MustCompile("^" + percentFmt + "$") -func IsValidPercent(percent string) bool { - return percentRegexp.MatchString(percent) +func IsValidPercent(percent string) []string { + if !percentRegexp.MatchString(percent) { + return []string{RegexError(percentFmt, "1%", "93%")} + } + return nil } -const HTTPHeaderNameFmt string = "[-A-Za-z0-9]+" +const httpHeaderNameFmt string = "[-A-Za-z0-9]+" -var httpHeaderNameRegexp = regexp.MustCompile("^" + HTTPHeaderNameFmt + "$") +var httpHeaderNameRegexp = regexp.MustCompile("^" + httpHeaderNameFmt + "$") // IsHTTPHeaderName checks that a string conforms to the Go HTTP library's // definition of a valid header field name (a stricter subset than RFC7230). -func IsHTTPHeaderName(value string) bool { - return httpHeaderNameRegexp.MatchString(value) +func IsHTTPHeaderName(value string) []string { + if !httpHeaderNameRegexp.MatchString(value) { + return []string{RegexError(httpHeaderNameFmt, "X-Header-Name")} + } + return nil +} + +const configMapKeyFmt = "\\.?" + dns1123SubdomainFmt + +var configMapKeyRegexp = regexp.MustCompile("^" + configMapKeyFmt + "$") + +// IsConfigMapKey tests for a string that conforms to the definition of a +// subdomain in DNS (RFC 1123), except that a leading dot is allowed +func IsConfigMapKey(value string) []string { + var errs []string + if len(value) > DNS1123SubdomainMaxLength { + errs = append(errs, MaxLenError(DNS1123SubdomainMaxLength)) + } + if !configMapKeyRegexp.MatchString(value) { + errs = append(errs, RegexError(configMapKeyFmt, "key.name")) + } + return errs } // MaxLenError returns a string explanation of a "string too long" validation @@ -260,3 +298,9 @@ func prefixEach(msgs []string, prefix string) []string { } return msgs } + +// InclusiveRangeError returns a string explanation of a numeric "must be +// between" validation failure. +func InclusiveRangeError(lo, hi int) string { + return fmt.Sprintf(`must be between %d and %d, inclusive`, lo, hi) +} diff --git a/vendor/k8s.io/kubernetes/pkg/util/wait/doc.go b/vendor/k8s.io/kubernetes/pkg/util/wait/doc.go index 240397a22..ff89dc170 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/wait/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/wait/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go b/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go index b56560e75..bd4543eb1 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go +++ b/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/workqueue/default_rate_limiters.go b/vendor/k8s.io/kubernetes/pkg/util/workqueue/default_rate_limiters.go index 6ca484b62..cf3c4d94e 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/workqueue/default_rate_limiters.go +++ b/vendor/k8s.io/kubernetes/pkg/util/workqueue/default_rate_limiters.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/workqueue/delaying_queue.go b/vendor/k8s.io/kubernetes/pkg/util/workqueue/delaying_queue.go index 429d15c4a..f24c88155 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/workqueue/delaying_queue.go +++ b/vendor/k8s.io/kubernetes/pkg/util/workqueue/delaying_queue.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -39,11 +39,12 @@ func NewDelayingQueue() DelayingInterface { func newDelayingQueue(clock util.Clock) DelayingInterface { ret := &delayingType{ - Interface: New(), - clock: clock, - heartbeat: clock.Tick(maxWait), - stopCh: make(chan struct{}), - waitingForAddCh: make(chan waitFor, 1000), + Interface: New(), + clock: clock, + heartbeat: clock.Tick(maxWait), + stopCh: make(chan struct{}), + waitingTimeByEntry: map[t]time.Time{}, + waitingForAddCh: make(chan waitFor, 1000), } go ret.waitingLoop() @@ -66,6 +67,8 @@ type delayingType struct { // waitingForAdd is an ordered slice of items to be added to the contained work queue waitingForAdd []waitFor + // waitingTimeByEntry holds wait time by entry, so we can lookup pre-existing indexes + waitingTimeByEntry map[t]time.Time // waitingForAddCh is a buffered channel that feeds waitingForAdd waitingForAddCh chan waitFor } @@ -118,6 +121,7 @@ func (q *delayingType) waitingLoop() { if q.Interface.ShuttingDown() { // discard waiting entries q.waitingForAdd = nil + q.waitingTimeByEntry = nil return } @@ -130,6 +134,7 @@ func (q *delayingType) waitingLoop() { break } q.Add(entry.data) + delete(q.waitingTimeByEntry, entry.data) readyEntries++ } q.waitingForAdd = q.waitingForAdd[readyEntries:] @@ -152,7 +157,7 @@ func (q *delayingType) waitingLoop() { case waitEntry := <-q.waitingForAddCh: if waitEntry.readyAt.After(q.clock.Now()) { - q.waitingForAdd = insert(q.waitingForAdd, waitEntry) + q.waitingForAdd = insert(q.waitingForAdd, q.waitingTimeByEntry, waitEntry) } else { q.Add(waitEntry.data) } @@ -162,7 +167,7 @@ func (q *delayingType) waitingLoop() { select { case waitEntry := <-q.waitingForAddCh: if waitEntry.readyAt.After(q.clock.Now()) { - q.waitingForAdd = insert(q.waitingForAdd, waitEntry) + q.waitingForAdd = insert(q.waitingForAdd, q.waitingTimeByEntry, waitEntry) } else { q.Add(waitEntry.data) } @@ -177,7 +182,20 @@ func (q *delayingType) waitingLoop() { // inserts the given entry into the sorted entries list // same semantics as append()... the given slice may be modified, // and the returned value should be used -func insert(entries []waitFor, entry waitFor) []waitFor { +func insert(entries []waitFor, knownEntries map[t]time.Time, entry waitFor) []waitFor { + // if the entry is already in our retry list and the existing time is before the new one, just skip it + existingTime, exists := knownEntries[entry.data] + if exists && existingTime.Before(entry.readyAt) { + return entries + } + + // if the entry exists and is scheduled for later, go ahead and remove the entry + if exists { + if existingIndex := findEntryIndex(entries, existingTime, entry.data); existingIndex >= 0 && existingIndex < len(entries) { + entries = append(entries[:existingIndex], entries[existingIndex+1:]...) + } + } + insertionIndex := sort.Search(len(entries), func(i int) bool { return entry.readyAt.Before(entries[i].readyAt) }) @@ -189,5 +207,24 @@ func insert(entries []waitFor, entry waitFor) []waitFor { // insert the record entries[insertionIndex] = entry + knownEntries[entry.data] = entry.readyAt + return entries } + +// findEntryIndex returns the index for an existing entry +func findEntryIndex(entries []waitFor, existingTime time.Time, data t) int { + index := sort.Search(len(entries), func(i int) bool { + return entries[i].readyAt.After(existingTime) || existingTime == entries[i].readyAt + }) + + // we know this is the earliest possible index, but there could be multiple with the same time + // iterate from here to find the dupe + for ; index < len(entries); index++ { + if entries[index].data == data { + break + } + } + + return index +} diff --git a/vendor/k8s.io/kubernetes/pkg/util/workqueue/doc.go b/vendor/k8s.io/kubernetes/pkg/util/workqueue/doc.go index d53d36d9f..2a00c74ac 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/workqueue/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/util/workqueue/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/workqueue/parallelizer.go b/vendor/k8s.io/kubernetes/pkg/util/workqueue/parallelizer.go index 9b773d538..a9305935b 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/workqueue/parallelizer.go +++ b/vendor/k8s.io/kubernetes/pkg/util/workqueue/parallelizer.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/workqueue/queue.go b/vendor/k8s.io/kubernetes/pkg/util/workqueue/queue.go index 40f2ba2fa..63fdd8191 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/workqueue/queue.go +++ b/vendor/k8s.io/kubernetes/pkg/util/workqueue/queue.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/util/workqueue/rate_limitting_queue.go b/vendor/k8s.io/kubernetes/pkg/util/workqueue/rate_limitting_queue.go index 272ba52d9..a4f86eb10 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/workqueue/rate_limitting_queue.go +++ b/vendor/k8s.io/kubernetes/pkg/util/workqueue/rate_limitting_queue.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/util/yaml/decoder.go b/vendor/k8s.io/kubernetes/pkg/util/yaml/decoder.go index a48a6ce86..6a9f05a58 100644 --- a/vendor/k8s.io/kubernetes/pkg/util/yaml/decoder.go +++ b/vendor/k8s.io/kubernetes/pkg/util/yaml/decoder.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/version/base.go b/vendor/k8s.io/kubernetes/pkg/version/base.go index fd6404775..475bd0660 100644 --- a/vendor/k8s.io/kubernetes/pkg/version/base.go +++ b/vendor/k8s.io/kubernetes/pkg/version/base.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/version/doc.go b/vendor/k8s.io/kubernetes/pkg/version/doc.go index c0397829d..ccedec76f 100644 --- a/vendor/k8s.io/kubernetes/pkg/version/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/version/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/version/semver.go b/vendor/k8s.io/kubernetes/pkg/version/semver.go index 1b5a845ad..1f4067e21 100644 --- a/vendor/k8s.io/kubernetes/pkg/version/semver.go +++ b/vendor/k8s.io/kubernetes/pkg/version/semver.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/version/version.go b/vendor/k8s.io/kubernetes/pkg/version/version.go index b8ac0d6c3..1e9313217 100644 --- a/vendor/k8s.io/kubernetes/pkg/version/version.go +++ b/vendor/k8s.io/kubernetes/pkg/version/version.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/doc.go b/vendor/k8s.io/kubernetes/pkg/watch/doc.go index fd9b437e1..5fde5e742 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/doc.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/filter.go b/vendor/k8s.io/kubernetes/pkg/watch/filter.go index 1eff5b949..3ca27f22c 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/filter.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/filter.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/mux.go b/vendor/k8s.io/kubernetes/pkg/watch/mux.go index 700c26bca..ec6de050e 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/mux.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/mux.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/streamwatcher.go b/vendor/k8s.io/kubernetes/pkg/watch/streamwatcher.go index 2802a9e01..26cf61d05 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/streamwatcher.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/streamwatcher.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/until.go b/vendor/k8s.io/kubernetes/pkg/watch/until.go index 9f34f9d00..4259f51bb 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/until.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/until.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/versioned/decoder.go b/vendor/k8s.io/kubernetes/pkg/watch/versioned/decoder.go index 2d13ca809..e5865273e 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/versioned/decoder.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/versioned/decoder.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/versioned/encoder.go b/vendor/k8s.io/kubernetes/pkg/watch/versioned/encoder.go index 8438ee984..df23e0bd1 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/versioned/encoder.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/versioned/encoder.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.pb.go b/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.pb.go index c1cbbd8ba..d2576ebd2 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.pb.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.proto b/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.proto index 5bb702210..8d5506552 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.proto +++ b/vendor/k8s.io/kubernetes/pkg/watch/versioned/generated.proto @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/versioned/register.go b/vendor/k8s.io/kubernetes/pkg/watch/versioned/register.go index feaea3b6b..e90a021a4 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/versioned/register.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/versioned/register.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/versioned/types.go b/vendor/k8s.io/kubernetes/pkg/watch/versioned/types.go index ba608aeab..f8e968ccc 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/versioned/types.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/versioned/types.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. diff --git a/vendor/k8s.io/kubernetes/pkg/watch/watch.go b/vendor/k8s.io/kubernetes/pkg/watch/watch.go index e8fca0a62..96b2fe3de 100644 --- a/vendor/k8s.io/kubernetes/pkg/watch/watch.go +++ b/vendor/k8s.io/kubernetes/pkg/watch/watch.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors All rights reserved. +Copyright 2014 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. diff --git a/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/gcp/gcp.go b/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/gcp/gcp.go index 1efbb20f1..32cbb3625 100644 --- a/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/gcp/gcp.go +++ b/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/gcp/gcp.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/oidc/oidc.go b/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/oidc/oidc.go index 3ad279c10..690a45230 100644 --- a/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/oidc/oidc.go +++ b/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/oidc/oidc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/plugins.go b/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/plugins.go index 2b422ddda..17d3ad427 100644 --- a/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/plugins.go +++ b/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/plugins.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/kubernetes/third_party/forked/json/fields.go b/vendor/k8s.io/kubernetes/third_party/forked/golang/json/fields.go similarity index 100% rename from vendor/k8s.io/kubernetes/third_party/forked/json/fields.go rename to vendor/k8s.io/kubernetes/third_party/forked/golang/json/fields.go diff --git a/vendor/k8s.io/kubernetes/third_party/forked/reflect/deep_equal.go b/vendor/k8s.io/kubernetes/third_party/forked/golang/reflect/deep_equal.go similarity index 100% rename from vendor/k8s.io/kubernetes/third_party/forked/reflect/deep_equal.go rename to vendor/k8s.io/kubernetes/third_party/forked/golang/reflect/deep_equal.go diff --git a/vendor/k8s.io/kubernetes/third_party/forked/golang/reflect/type.go b/vendor/k8s.io/kubernetes/third_party/forked/golang/reflect/type.go new file mode 100644 index 000000000..67957ee33 --- /dev/null +++ b/vendor/k8s.io/kubernetes/third_party/forked/golang/reflect/type.go @@ -0,0 +1,91 @@ +//This package is copied from Go library reflect/type.go. +//The struct tag library provides no way to extract the list of struct tags, only +//a specific tag +package reflect + +import ( + "fmt" + + "strconv" + "strings" +) + +type StructTag struct { + Name string + Value string +} + +func (t StructTag) String() string { + return fmt.Sprintf("%s:%q", t.Name, t.Value) +} + +type StructTags []StructTag + +func (tags StructTags) String() string { + s := make([]string, 0, len(tags)) + for _, tag := range tags { + s = append(s, tag.String()) + } + return "`" + strings.Join(s, " ") + "`" +} + +func (tags StructTags) Has(name string) bool { + for i := range tags { + if tags[i].Name == name { + return true + } + } + return false +} + +// ParseStructTags returns the full set of fields in a struct tag in the order they appear in +// the struct tag. +func ParseStructTags(tag string) (StructTags, error) { + tags := StructTags{} + for tag != "" { + // Skip leading space. + i := 0 + for i < len(tag) && tag[i] == ' ' { + i++ + } + tag = tag[i:] + if tag == "" { + break + } + + // Scan to colon. A space, a quote or a control character is a syntax error. + // Strictly speaking, control chars include the range [0x7f, 0x9f], not just + // [0x00, 0x1f], but in practice, we ignore the multi-byte control characters + // as it is simpler to inspect the tag's bytes than the tag's runes. + i = 0 + for i < len(tag) && tag[i] > ' ' && tag[i] != ':' && tag[i] != '"' && tag[i] != 0x7f { + i++ + } + if i == 0 || i+1 >= len(tag) || tag[i] != ':' || tag[i+1] != '"' { + break + } + name := string(tag[:i]) + tag = tag[i+1:] + + // Scan quoted string to find value. + i = 1 + for i < len(tag) && tag[i] != '"' { + if tag[i] == '\\' { + i++ + } + i++ + } + if i >= len(tag) { + break + } + qvalue := string(tag[:i+1]) + tag = tag[i+1:] + + value, err := strconv.Unquote(qvalue) + if err != nil { + return nil, err + } + tags = append(tags, StructTag{Name: name, Value: value}) + } + return tags, nil +} diff --git a/vendor/k8s.io/kubernetes/third_party/golang/template/exec.go b/vendor/k8s.io/kubernetes/third_party/forked/golang/template/exec.go similarity index 100% rename from vendor/k8s.io/kubernetes/third_party/golang/template/exec.go rename to vendor/k8s.io/kubernetes/third_party/forked/golang/template/exec.go diff --git a/vendor/k8s.io/kubernetes/third_party/golang/template/funcs.go b/vendor/k8s.io/kubernetes/third_party/forked/golang/template/funcs.go similarity index 100% rename from vendor/k8s.io/kubernetes/third_party/golang/template/funcs.go rename to vendor/k8s.io/kubernetes/third_party/forked/golang/template/funcs.go diff --git a/vendor/k8s.io/kubernetes/third_party/forked/json/LICENSE b/vendor/k8s.io/kubernetes/third_party/forked/json/LICENSE deleted file mode 100644 index 744875676..000000000 --- a/vendor/k8s.io/kubernetes/third_party/forked/json/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/k8s.io/kubernetes/third_party/forked/reflect/LICENSE b/vendor/k8s.io/kubernetes/third_party/forked/reflect/LICENSE deleted file mode 100644 index 744875676..000000000 --- a/vendor/k8s.io/kubernetes/third_party/forked/reflect/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.